Platform: e not a function / e.lift not a function when building for prod

Created on 2 Dec 2019  路  8Comments  路  Source: ngrx/platform

Minimal reproduction of the bug/regression with instructions:

Repo that shows the error.
https://github.com/bjornharvold/ngrx-prod-issue

  • Verify that it works with "ng serve" by running ./runDeveloper.sh
  • Verify that it does not work when building to prod with ./buildDeveloperProd.sh. (run static assets on some server)

Expected behavior:

Have spent the whole day trying to figure out why ngrx is not working when building a production bundle. I have a working SPA w ngrx working in production but I cannot deploy an update because the new version doesn't work and I cannot figure out what it is.

I've stripped down the project and put it in the repo above. Please advise.

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):

Angular CLI: 8.3.20
Node: 12.13.1
OS: darwin x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, elements
... forms, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Package Version

@angular-devkit/architect 0.803.20
@angular-devkit/build-angular 0.803.20
@angular-devkit/build-ng-packagr 0.803.20
@angular-devkit/build-optimizer 0.803.20
@angular-devkit/build-webpack 0.803.20
@angular-devkit/core 8.3.20
@angular-devkit/schematics 8.3.20
@angular/cdk 8.2.3
@angular/cli 8.3.20
@angular/flex-layout 8.0.0-beta.27
@angular/material 8.2.3
@angular/pwa 0.803.20
@ngtools/webpack 8.3.20
@schematics/angular 8.3.20
@schematics/update 0.803.20
ng-packagr 5.7.1
rxjs 6.5.3
typescript 3.5.3
webpack 4.39.2
ngrx 8.5.2

I would be willing to submit a PR to fix this issue

[ ] Yes (Assistance is provided if you need help submitting a pull request)
[x] No

Screen Shot 2019-12-02 at 9 22 10 PM

Most helpful comment

馃槈 Whenever I see errors that point back to build optimizer, its usually an upstream issue with the CLI, as we haven't changed the way we package and distribute the libraries. I reached out to the CLI team, and they pointed me to the cause.

All 8 comments

Hi, my platform in production is experiencing the same issue. Could it be a dependency of a library that changed?

Confirming the issue

Is there a dependency that is updated recently @bjornharvold?

Seems related to ofType, leave these out and it does work ... not sure why.

Also having the same issue with our prod build. Looks like an action string is triggering the 'not a function' error
Screen Shot 2019-12-02 at 3 11 50 PM

This was a bug in an upstream package that has been fixed. Pin the terser package to 4.4.0 or 4.4.2 as a workaround.

https://github.com/angular/angular/pull/34179

@brandonroberts Great detective work!! My eyes were burning last night after having tried to resolve this one. How did you figure this one out? Yes, @timdeschryver - the only dep update was Angular CLI 8.3.20.

馃槈 Whenever I see errors that point back to build optimizer, its usually an upstream issue with the CLI, as we haven't changed the way we package and distribute the libraries. I reached out to the CLI team, and they pointed me to the cause.

Was this page helpful?
0 / 5 - 0 ratings