primeng icon indicating copy to clipboard operation
primeng copied to clipboard

angular universe + prime NG build error.

Open lubkoKuzenko opened this issue 9 years ago • 5 comments

Hi all, i've faced issue during angular universe build.

from PrimeNG i'm using 2 modules: import {GMapModule} from 'primeng/primeng'; import {DataTableModule,SharedModule} from 'primeng/primeng';

and this is the error: [nodemon] 1.11.0 [nodemon] to restart at any time, enter rs [nodemon] watching: /Users/lubko/Desktop/off_starter/dist/**/* [nodemon] starting node dist/server.js` /Users/lubko/Desktop/off_starter/dist/server.js:132238 __metadata("design:paramtypes", [Event]), ^

ReferenceError: Event is not defined at Object../node_modules/primeng/components/tooltip/tooltip.js (/Users/lubko/Desktop/off_starter/dist/server.js:132238:38) at webpack_require (/Users/lubko/Desktop/off_starter/dist/server.js:26:30) at Object../node_modules/primeng/primeng.js (/Users/lubko/Desktop/off_starter/dist/server.js:133690:10) at webpack_require (/Users/lubko/Desktop/off_starter/dist/server.js:26:30) at Object../src/app/app.module.ts (/Users/lubko/Desktop/off_starter/dist/server.js:147204:74) at webpack_require (/Users/lubko/Desktop/off_starter/dist/server.js:26:30) at Object../src/app/server.app.module.ts (/Users/lubko/Desktop/off_starter/dist/server.js:147596:70) at webpack_require (/Users/lubko/Desktop/off_starter/dist/server.js:26:30) at Object. (/Users/lubko/Desktop/off_starter/dist/server.js:148382:81) at Object../src/server.ts (/Users/lubko/Desktop/off_starter/dist/server.js:148434:30) [nodemon] app crashed - waiting for file changes before starting...`

lubkoKuzenko avatar May 21 '17 15:05 lubkoKuzenko

Have you tried with configuration in tsconfig.js "lib": ["dom","es6"],

You can also check these threads for solutions or workarounds

https://github.com/primefaces/primeng/issues/2167 https://github.com/primefaces/primeng/issues/1341

sudheerj avatar May 22 '17 03:05 sudheerj

This can help me but how to solve the problem?

Don't use components that are problematic (Growl, DataGrid, etc) Use these components only in lazy-loaded modules so they are only executed client-side

lubkoKuzenko avatar May 22 '17 10:05 lubkoKuzenko

follow me know, primeng in present not support prerendering of universal so if you want use it...maybe waiting update later

meanle11 avatar May 23 '17 02:05 meanle11

Please create separate issue tickets like "Growl support for Universal" so we can track them one by one to manage the Universal support properly.

cagataycivici avatar Jun 23 '17 08:06 cagataycivici

When you delete the tooltip, growl and datagrid export from primeng.js and primeng.d.ts universal works. I've created a gulpfile which puts these exports in comments before building.

twanbraas avatar Aug 10 '17 09:08 twanbraas