Platform: lost reducer when aot

Created on 24 Jan 2018  ·  6Comments  ·  Source: ngrx/platform

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[*] Bug report  
[ ] Feature request
[ ] Documentation issue or request

What is the current behavior?

aot mode lost many reducers.

Expected behavior:


same reducers with dev mode

Minimal reproduction of the problem with instructions:

Version of affected browser(s),operating system(s), npm, node and ngrx:

   _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.5
Node: 6.9.5
OS: win32 x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.5
@angular/platform-server: 4.4.6
@angular-devkit/build-optimizer: 0.0.41
@angular-devkit/core: 0.0.28
@angular-devkit/schematics: 0.0.51
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.5
@schematics/angular: 0.1.16
typescript: 2.5.3
webpack: 3.10.0

package.json

"dependencies": {
    "@angular/platform-server": "^4.2.4",
    "angular2-uuid": "^1.1.1",
    "ng-http-interceptor": "^3.1.1",
    "ngrx-store-logger": "^0.1.8",
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@ngrx/store": "^5.0.0",
    "@ngrx/store-devtools": "^5.0.0",
     ...
  },

Other information:

image
image
image
image
image
image

Most helpful comment

This is more likely an AoT issue than with ngrx. If you're going to be manipulating the reducer map that way you need to use a token to inject your reducers: https://github.com/ngrx/platform/blob/master/docs/store/api.md#injecting-reducers

All 6 comments

The official demo

image

image

Experiencing the same problem.

Is this after upgrading to 5.0.0 from 4.1.1?

from 2.2.2

"@ngrx/core": "^1.2.0",
"@ngrx/store": "^2.2.2",
"@ngrx/store-devtools": "^3.2.4",

the official demo
image

the plunker ngrx 5.0.0 on jit mode
it works.

but not work on aot mode.

This is more likely an AoT issue than with ngrx. If you're going to be manipulating the reducer map that way you need to use a token to inject your reducers: https://github.com/ngrx/platform/blob/master/docs/store/api.md#injecting-reducers

Was this page helpful?
0 / 5 - 0 ratings