-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial state still empty in AOT as of v4.1.0 #515
Comments
@GiuseppePiscopo I haven't been able to reproduce this in the example app using the |
Ok, I'll try. BTW, where's the example app? And, is there a plunker or stackblitz seed, ngrx-included, to start with? Thanks |
The example app is in this repo https://github.com/ngrx/platform/tree/master/example-app |
Thanks, currently working at it. Actually I first "moved" example app into a new empty ng-cli project. At the moment I'm not able to reproduce the issue there. If it might help: initially I met some funny errors related to angular material and MaterialModule not being defined. Apparently there have been some breaking changes across beta versions and one way to fix them is by pinning them to some specific versions: "@angular/material": "2.0.0-beta.7",
"@angular/cdk": "2.0.0-beta.8", |
As said, I was not able to reproduce the issue then, and I'm not having time to try again, so I'd say we can close this. OT you might want to give a shot at that dependency issue mentioned in comment above. HTH Regards |
We landed a PR to lock the material versions. Thanks |
I'm submitting a...
I've read through related issues, #116 , #189 , #247 and especially, #258 . I've successfully applied the
InjectionToken
/getReducers
workaround as suggested in latest comment by @brandonroberts .It is not clear to me whether injecting reducers map by token is the way to go forward or what. If that's the case, would you consider a PR making this explicit in docs? Otherwise, this issue is to notify that AOT problem still persists as of 4.1.0.
What is the current behavior?
When a ng-cli based project is built for production with AOT enabled, at runtime the application state seems to be stuck as an empty object
{}
. Initial state passed in single reducers seems to be ignored. Also trying to pass initial state when callingStoreModule.forRoot(...)
seems to be ignored. The only change I could experience in application state has been when some router action was fired: then just the router slice of app state was created.When project is built for development, app state is correctly populated. I've not tried building for production but with AOT disabled.
Expected behavior:
Even when compiling project for production, with AOT enabled, application state should be correctly populated as in development build.
Minimal reproduction of the problem with instructions:
Sorry for not providing a demo. Is there a seed project available in stackblitz? I took it you can try AOT builds there, as opposed to Plunker.
Steps:
Version of affected browser(s),operating system(s), npm, node and ngrx:
Tried with Google Chrome 61.0.3163.100 64 bits
Windows 10 64 bits
node v6.9.5
npm 3.10.10
ngrx 4.1.0
angular 4.3.4
Other information:
The text was updated successfully, but these errors were encountered: