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

10.5.0 - 11.0.3 Console error in production build #1114

Open TomMettam opened 6 years ago

TomMettam commented 6 years ago

I'm submitting a ...

[X] **bug report**

Current behavior As of 10.5.0, ngx-datatable triggers an error in zone.js subscribe - but only in a production build.

core.js:1350 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'subscribe' of undefined
TypeError: Cannot read property 'subscribe' of undefined
    at Pn (core.js:12014)
    at hr (core.js:13448)
    at Tr (core.js:13880)
    at Pr (core.js:13789)
    at hr (core.js:13476)
    at Tr (core.js:13880)
    at Pr (core.js:13789)
    at hr (core.js:13476)
    at cr (core.js:13338)
    at Object.Mr [as createRootView] (core.js:14025)
    at Pn (core.js:12014)
    at hr (core.js:13448)
    at Tr (core.js:13880)
    at Pr (core.js:13789)
    at hr (core.js:13476)
    at Tr (core.js:13880)
    at Pr (core.js:13789)
    at hr (core.js:13476)
    at cr (core.js:13338)
    at Object.Mr [as createRootView] (core.js:14025)
    at u (polyfills.76bc5925d9fb9c6d1bc0.bundle.js:1)
    at u (polyfills.76bc5925d9fb9c6d1bc0.bundle.js:1)
    at polyfills.76bc5925d9fb9c6d1bc0.bundle.js:1
    at t.invokeTask (polyfills.76bc5925d9fb9c6d1bc0.bundle.js:1)
    at Object.onInvokeTask (core.js:4617)
    at t.invokeTask (polyfills.76bc5925d9fb9c6d1bc0.bundle.js:1)
    at r.runTask (polyfills.76bc5925d9fb9c6d1bc0.bundle.js:1)
    at o (polyfills.76bc5925d9fb9c6d1bc0.bundle.js:1)
    at 
S @ core.js:1350

This error does not manifest in 10.4.0. It does not manifest when using a regular / debug build.

Expected behavior I would expect the ngx-datatable component to behave as it does with a development build.

Reproduction of the problem

Package versions used:

"@angular/core": "^5.0.0",
"zone.js": "^0.8.4"
 "rxjs": "^5.5.2",
"@swimlane/ngx-datatable": "^11.0.3"

Run with ng serve --prod, notice the component fails to load with browser console errors.

Alternatively build with ng build --target="production" to see the same issue.

10.4.0 works fine.

TomMettam commented 6 years ago

Here's the call stack when the error is triggered:

https://gyazo.com/b41483720faaa19c8d98fa1398c143b5

TomMettam commented 6 years ago

Same issue present in all 11.0.x released up to the current 11.0.3.

RutledgePaulV commented 6 years ago

Looks like a duplicate of #1104