-
Notifications
You must be signed in to change notification settings - Fork 311
Initial Reducer is causing error in production build with angular-cli #406
Comments
You need to update to version |
I am having the same issue, even in the non-aot build. I am at 2.2.2 of ngrx/store. |
Also having the same issue, actions and payloads are registered with Redux devtools, but nothing is stored it seems. State is just empty always. It works in Dev mode, but not in --prod or --aot |
Non-minified stack trace:
|
I found a basic ngrx example at https://github.com/JimTheMan/Jims-Ngrx-Example/tree/master/jims-ngrx-eg/src/app and tried that to eliminate my code as being the cause, and I receive the same error. |
If you call Object.keys() on Chrome you'll get exactly this error
I see these calls inside combineReducers function. I'm not sure if your problem is this, but do not use |
@franciscotln I will try it out. Does it mean |
@fokusferit export default doesn't work with aot yet (for sure). Perhaps that will be useful for you: https://github.com/rangle/angular-2-aot-sandbox#current-status |
Thank you a lot ! This was something I needed back when I updated from beta angular-cli to final. |
Updated: Yes all my issues are related to things which are basically not supported in AoT like default exports, func-expressions as const export etc. For me it is now working as I changed
I can only recommend everyone to check this table -> https://github.com/rangle/angular-2-aot-sandbox#current-status |
Please check this against NgRx v4, and if it’s still an issue, please reopen on https://github.com/ngrx/platform. Thanks! |
Environment:
npm 4.4.4
node v6.10.1
Dependancies:
I've updated to the final angular-cli v1 version and also updated ngrx/store to 2.2.2 so everything is supporting ng4.
The current issue is that when I do
ng build
the development build is created and the application is up and running.When I do
ng build --prod
and open my application I get the following errors:I've already updated how reducers are created and solved a lot of issues. The store initialization is currently looking this way:
I've tried to debug the production bundle and discovered that there is the following check:
Here the function call
c.a(this.__INITIAL_REDUCER_55)
is returning the error becausethis.this.__INITIAL_REDUCER_55
is null.It looks like some checks expect an object / function but instead a null is floating around which breaks the initialization.
The text was updated successfully, but these errors were encountered: