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

Building for production using ionic3.7/angular4 #1076

Open MarkySparky opened 7 years ago

MarkySparky commented 7 years ago

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

When I view a production build of my project containing ngx-datatable, I always get an error in the console and a blank screen

Expected behavior

No error should appear and the app should load normally.

Reproduction of the problem

I am attempting to produce a prod build of a sample ionic app which includes @swimlane/ngx-datatable.

I have a repo with a blank ionic project showing the problem here: https://gitlab.com/markysparky/swimlane-datatable-error

npm run ionic:build --prod seems to works fine, but when I visit the resulting production site with Chrome, I get an error in the console.

Normal ionic serve works just fine.

What is the motivation / use case for changing the behavior?

i want to use your excellent datatable plugin with my Angular4 / ionic 3.7 app, and I need a valid production build to cut down load times.

Please tell us about your environment:

Mac OSX sierra, node 6.11.3, ionic 3.7.1, Angular 4.4.3

SiddharthSh commented 7 years ago

Hi, While building Angular 4 Web app for production, i received the same sort of error ERROR in /ngrx/node_modules/@swimlane/ngx-datatable/release/types/column-mode.type.d.ts (2,16): In ambient enum declarations member initializer must be constant expression.

ERROR in /ngrx/node_modules/@swimlane/ngx-datatable/release/types/column-mode.type.d.ts (3,12): In ambient enum declarations member initializer must be constant expression. .. and more comments like this...

Please let me know if any further information is required.

Regards

trik commented 7 years ago

@MarkySparky published a working tarball

MarkySparky commented 7 years ago

Awesome, i'll give it a go and get back...

MarkySparky commented 7 years ago

@trik How do I use that in my ionic / Angular project please? At the moment im just doing

import { NgxDatatableModule } from '@swimlane/ngx-datatable';

Not sure how to use the UMD bundle.

Thanks for your time on this

trik commented 7 years ago

@MarkySparky install it with this command npm i @swimlane/ngx-datatable@https://github.com/trik/ngx-datatable/releases/download/10.3.0-1/swimlane-ngx-datatable-10.3.0.tgz then follow the docs