Platform: effects not dispatched with build --prod

Created on 25 May 2019  路  9Comments  路  Source: ngrx/platform

Minimal reproduction of the bug/regression with instructions:

Github repo : https://github.com/adrienpsl/test-ngrx-data-effects

Expected behavior:

With ng build --prod :

  1. I call service.getAll() from my component
  2. data/action that extend EntityCollectionServiceBase are logged.
  3. data/effects that extends EntityCollectionServiceBase are not triggered or logged
    in the storeDevTool (that I that I have activated in production).

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

{
      // ngrx
      "@ngrx/data": "^8.0.0-beta.2",
      "@ngrx/effects": "github:ngrx/effects-builds",
      "@ngrx/entity": "github:ngrx/entity-builds",
      "@ngrx/router-store": "github:ngrx/router-store-builds",
      "@ngrx/store": "github:ngrx/store-builds",

      // angular cli
      "@angular/cli": "~8.0.0-rc.3",
      "@angular/compiler-cli": "~8.0.0-rc.4",

      // angular
      "@angular/compiler": "~8.0.0-rc.4",
      "@angular/core": "~8.0.0-rc.4",
}

Other information:

is this related to : https://github.com/l3ender/ngrx-aot/pull/1 ?

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

8.x Blocked (External) Effects bug

Most helpful comment

All 9 comments

This seems like the same problem as in https://github.com/johnpapa/angular-ngrx-data/issues/156.
I tried to reproduce it in the example app but wasn't possible to do so.

thank you for the quick answer :) .

I compile with macos mojave : 10.14.5 may be that osx is the problem ?
What is your operating system ?
I will try to compile on a vm linux

It isn't OS specific, if I run your repro it does in fact not run the effect.

@adrienpsl does this also occur with @ngrx/*@8.0.0-rc.0?

@adrienpsl, does this occur if you disable the angular cli build optimizer?

ng build --prod --no-build-optimizer

As this might be related to https://github.com/angular/angular-cli/issues/14613

I think they are related and consider this issue resolved. We will close it once the fix in the CLI is merged

Yes, it works !
I use the following : angular 8 / cli 8 / ngrx 8.0.1
:) .

Hi, I don't think this issue really solved.
Either that, or it is a regression.

With the current version of ngrx 8.2.0, still get the same problem when doign a --prod build.
it works if using the --optimization=false flag though

(also using 8.2.0 versions of angular/cli)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gperdomor picture gperdomor  路  3Comments

shyamal890 picture shyamal890  路  3Comments

dmytro-gokun picture dmytro-gokun  路  3Comments

bhaidar picture bhaidar  路  3Comments

mappedinn picture mappedinn  路  3Comments