So, I'm using a 'spinner' variable in my redux store to insert a class with ngClass on my progress bar and hide it/show it.
Now -- I know this is the culprit because if I remove all that logic everything is fine. This is an app that has been in production for a few months and everything worked up until upgradin to A7.
- I have tried using the @select() and | async pipe with ngIf. Removing the ngIf logic but leaving the spinner makes the error go away.
- I have tried filling a local variable based on the data from the store (if true hiddenSpinner="hiddenSpinner" else hiddenSpinner=""). Removing everything related in the markup does not make the error go away.
This makes me think it is purely something to do with the redux logic.
Everything works well if I run ng serve --prod.
All relevant redux store code:
//INTERFACE TYPES
export interface IAppState {
spinner: boolean;
}
// DEFAULT STATE
export const INITIAL_STATE: IAppState = {
spinner: false
};
//ROOT REDUCER
export function rootReducer(state: IAppState, action): IAppState {
switch (action.type) {
case START_LOADING: return startLoading(state, action);
case STOP_LOADING: return stopLoading(state, action);
}
return state;
}
// FUNCTIONS FOR REDUCER TO CALL
function startLoading(state, action) {
return tassign(state, { spinner: true});
}
function stopLoading(state, action) {
return tassign(state, { spinner: false});
}
The error :
ERROR TypeError: "e[n] is undefined"
unliftState http://localhost:4200/:2:30806
getState http://localhost:4200/:2:30882
storeToObservable http://localhost:4200/vendor.js:243:31
_trySubscribe http://localhost:4200/vendor.js:154754:20
subscribe http://localhost:4200/vendor.js:154740:17
subscribeTo http://localhost:4200/vendor.js:166005:24
subscribeToResult http://localhost:4200/vendor.js:166182:12
_innerSub http://localhost:4200/vendor.js:163001:34
_next http://localhost:4200/vendor.js:162991:9
next http://localhost:4200/vendor.js:155373:13
_next http://localhost:4200/vendor.js:160104:13
next http://localhost:4200/vendor.js:155373:13
_subscribe http://localhost:4200/vendor.js:154540:13
_trySubscribe http://localhost:4200/vendor.js:154754:20
_trySubscribe http://localhost:4200/vendor.js:155180:20
subscribe http://localhost:4200/vendor.js:154740:17
call http://localhost:4200/vendor.js:160081:16
subscribe http://localhost:4200/vendor.js:154735:13
call http://localhost:4200/vendor.js:162969:16
subscribe http://localhost:4200/vendor.js:154735:13
call http://localhost:4200/vendor.js:159541:16
subscribe http://localhost:4200/vendor.js:154735:13
call http://localhost:4200/vendor.js:160642:16
subscribe http://localhost:4200/vendor.js:154735:13
call http://localhost:4200/vendor.js:159541:16
subscribe http://localhost:4200/vendor.js:154735:13
ngOnInit http://localhost:4200/main.js:185:36
checkAndUpdateDirectiveInline http://localhost:4200/vendor.js:77713:9
checkAndUpdateNodeInline http://localhost:4200/vendor.js:78977:20
checkAndUpdateNode http://localhost:4200/vendor.js:78939:16
debugCheckAndUpdateNode http://localhost:4200/vendor.js:79573:19
debugCheckDirectivesFn http://localhost:4200/vendor.js:79533:13
View_AppComponent_Host_0 ng:///AppModule/AppComponent_Host.ngfactory.js:9:5
debugUpdateDirectives http://localhost:4200/vendor.js:79525:12
checkAndUpdateView http://localhost:4200/vendor.js:78921:5
callWithDebugContext http://localhost:4200/vendor.js:79815:22
debugCheckAndUpdateView http://localhost:4200/vendor.js:79493:12
detectChanges http://localhost:4200/vendor.js:77302:13
tick http://localhost:4200/vendor.js:73964:58
tick http://localhost:4200/vendor.js:73964:13
_loadComponent http://localhost:4200/vendor.js:73998:9
bootstrap http://localhost:4200/vendor.js:73940:9
_moduleDoBootstrap http://localhost:4200/vendor.js:73741:74
_moduleDoBootstrap http://localhost:4200/vendor.js:73741:13
bootstrapModuleFactory http://localhost:4200/vendor.js:73709:21
invoke http://localhost:4200/polyfills.js:9654:17
onInvoke http://localhost:4200/vendor.js:73236:24
invoke http://localhost:4200/polyfills.js:9653:17
run http://localhost:4200/polyfills.js:9404:24
scheduleResolveOrReject http://localhost:4200/polyfills.js:10138:29
invokeTask http://localhost:4200/polyfills.js:9687:17
onInvokeTask http://localhost:4200/vendor.js:73227:24
invokeTask http://localhost:4200/polyfills.js:9686:17
runTask http://localhost:4200/polyfills.js:9454:28
drainMicroTaskQueue http://localhost:4200/polyfills.js:9861:25
core.js:12584
defaultErrorLogger
core.js:12584
./node_modules/@angular/core/fesm5/core.js/ErrorHandler.prototype.handleError
core.js:12632
next
core.js:14611:109
./node_modules/@angular/core/fesm5/core.js/EventEmitter.prototype.subscribe/schedulerFn<
core.js:10238:34
./node_modules/rxjs/_esm5/internal/Subscriber.js/SafeSubscriber.prototype.__tryOrUnsub
Subscriber.js:196
./node_modules/rxjs/_esm5/internal/Subscriber.js/SafeSubscriber.prototype.next
Subscriber.js:134
./node_modules/rxjs/_esm5/internal/Subscriber.js/Subscriber.prototype._next
Subscriber.js:77
./node_modules/rxjs/_esm5/internal/Subscriber.js/Subscriber.prototype.next
Subscriber.js:54
./node_modules/rxjs/_esm5/internal/Subject.js/Subject.prototype.next
Subject.js:47
./node_modules/@angular/core/fesm5/core.js/EventEmitter.prototype.emit
core.js:10222:52
onHandleError/<
core.js:14165:48
./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invoke
zone.js:388
./node_modules/zone.js/dist/zone.js/</Zone.prototype.run
zone.js:138
./node_modules/@angular/core/fesm5/core.js/NgZone.prototype.runOutsideAngular
core.js:14102
onHandleError
core.js:14165
./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.handleError
zone.js:392
./node_modules/zone.js/dist/zone.js/</Zone.prototype.runTask
zone.js:191
./node_modules/zone.js/dist/zone.js/</ZoneTask.invokeTask
zone.js:496
ZoneTask/this.invoke
zone.js:485
timer
zone.js:2054