[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
After upgrading to the new version of ngrx, I get the following error in my browser console:
core.js:1440 ERROR TypeError: Cannot read property 'state' of undefined
at MapSubscriber.unliftState [as project] (store-devtools.es5.js:163)
at MapSubscriber._next (map.js:79)
at MapSubscriber.Subscriber.next (Subscriber.js:92)
at ReplaySubject._subscribe (ReplaySubject.js:61)
at ReplaySubject.Observable._trySubscribe (Observable.js:172)
at ReplaySubject.Subject._trySubscribe (Subject.js:98)
at ReplaySubject.Observable.subscribe (Observable.js:160)
at Observable._subscribe (Observable.js:231)
at Observable.subscribe (Observable.js:160)
at MapOperator.call (map.js:57)
that line in store-devtools corresponds to the second line of this function:
/**
* Provides an app's view into the state of the lifted store.
* @param {?} liftedState
* @return {?}
*/
function unliftState(liftedState) {
var computedStates = liftedState.computedStates, currentStateIndex = liftedState.currentStateIndex;
var state = computedStates[currentStateIndex].state;
return state;
}
no Error.
I don't have a minimal repro yet. I assume it won't be trivial to reproduce, since it hasn't been seen before the release. I can say that our application makes extensive use of lazy loaded modules, including using StoreModule.forFeature in multiple modules.
Without StoreDevtools, there are no problems upgrading, as far as I can tell.
Chrome Version 63.0.3239.132
ngrx 5
node 9.3.0
Seeing the same behavior here.
Same here, seems it's trying to access an index that's out of bounds. Also, seems like a duplicate of #624
Yeah, it may be a duplicate. Here is a bit more information:

currentStates is an array of length 1, but currentStateIndex is set to 1, hence the undefined error. Not sure what is going on in there, but it seems that it shouldn't be possible for currentStateIndex to be larger than the largest index on currentStates.
Update, I was able to fix this module by changing the order of my imports, as described here:
https://github.com/ngrx/platform/issues/624#issuecomment-360147672
Specifically, I got the error when I had StoreModule.forFeature imports before StoreDevtoolsModule.instrument, and the error went away when I ensured that devtools were imported before the feature module.
I'm leaving this issue open, because I'm not certain this is not a bug, and because the visibility may help others who have the same issue upgrading.
I can confirm it now works for me to!
Unfortunately it does not work for me. The only way to not break is to put it like so:
!environment.production ? StoreDevtoolsModule.instrument({name: 'name'}) : [],
StoreModule.forRoot(reducers , { metaReducers }),
which unfortunately does not connect the store to the dev tools at all.
Same here. I have everything in the correct order yet still getting this error.
And as @mwawrusch said. You can put it above the StoreModule however then it can't find the store at all...
Could really do with a solution to this asap as I'm trying to learn how to use ngrx and the dev tools would be a great visual aid.
@mwawrusch @WillPoulson Any of you guys importing other modules beforehand that are creating feature states? That'll make sure this breaks too.
@wesselvdv Nope, I only have one feature module and that gets imported after the state and dev tools.
Did someone find any solution? I'm having the same behavior in my project :-(
This is not fixed right? any next releases have this one addressed.
Most helpful comment
Update, I was able to fix this module by changing the order of my imports, as described here:
https://github.com/ngrx/platform/issues/624#issuecomment-360147672
Specifically, I got the error when I had
StoreModule.forFeatureimports beforeStoreDevtoolsModule.instrument, and the error went away when I ensured that devtools were imported before the feature module.I'm leaving this issue open, because I'm not certain this is not a bug, and because the visibility may help others who have the same issue upgrading.