swimlane / ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular
http://swimlane.github.io/ngx-datatable/
MIT License
4.63k stars 1.68k forks source link

NodeInvocationException: Prerendering failed: ReferenceError: Event is not defined #1133

Open helloneoberg opened 7 years ago

helloneoberg commented 7 years ago

Added the statement below in package.json after installing "@swimlane/ngx-datatable": "^11.0.4",

In my app.module.ts: import { NgxDatatableModule } from '@swimlane/ngx-datatable'; This itself doesn't throw any error.

imports: [ CommonModule, HttpModule, FormsModule, Ng2BootstrapModule.forRoot(), TransferHttpModule, NgxDatatableModule, BrowserModule ]

With the import, the below error happen. Please advise me.

I'm submitting a ... (check one with "x")

[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior NodeInvocationException: Prerendering failed because of error: ReferenceError: Event is not defined at C:\Project\AnglarUniversal4\ClientApp\dist\main-server.js:168292:42

Expected behavior My main page should run as per normal

Reproduction of the problem Download the template from: https://github.com/MarkPieszak/aspnetcore-angular2-universal 1) npm install @swimlane/ngx-datatable 2) add "@swimlane/ngx-datatable": "^11.0.4" to packaga.json 3) In app.module.ts, add the statement: import { NgxDatatableModule } from '@swimlane/ngx-datatable'; 4) In app.module.ts, import NgxDatatableModule The issue should happen again

What is the motivation / use case for changing the behavior? to user ngx-datatable in my solution

Please tell us about your environment: just using Window 10 and Visual Studio 2017

Farre82 commented 6 years ago

I have the same issue, Please help!

heinerurena commented 6 years ago

Same problem. Any news?

helloneoberg commented 6 years ago

i read some issue listed https://github.com/swimlane/ngx-datatable/pull/1121 https://github.com/swimlane/ngx-datatable/issues/1042 and it make me think that probably the ngx-datatable won't work with Server Side Rendering and i am using Angular Universal which is SSR, thus i won't be able to use this component. Correct me if i am wrong. Thank you.

amcdnl commented 6 years ago

I haven't done any testing w/ Universal. Its on the list tho. I'll poke around and see if I find anything obvious.

helloneoberg commented 6 years ago

Sure thanks amcdnl. Please update if it is working with Angular Universal.