0

I am trying to instrument StoreDevTools with an oldish version of Angular (4.1.x) and @ngrx/store (5.2.0).

The zone.js version installed is 0.8.29

If I do the recommended way (ie. after StoreModule and EffectsModule) (app.module.ts):

    StoreModule.forRoot({}),
    EffectsModule.forRoot([]),

    StoreDevtoolsModule.instrument({
        name: 'myApp',
        maxAge: 50,
    }),

then the StoreDevTools crash with

Error:
zone.js?6788:682 Unhandled Promise rejection: Object(...) is not a function ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Object(...) is not a function
    at new StoreDevtools (store-devtools.js?51ff:764)

the js line referred says:

var liftedAction$ = merge(merge(actions$.asObservable().pipe(skip(1)), extension.actions$).pipe(map(liftAction)), dispatcher, extension.liftedActions$).pipe(observeOn(queueScheduler));

When I do the other way around, the StoreDevTols don't crash, but the inspector cannot see the store in there.

Both modules are receiving empty data because I am just putting the store in place and I start with a feature module.

    StoreModule.forFeature('Feature1', feature1Reducer),
    EffectsModule.forFeature([
        Feature1Effects,
    ]),

There is no data stored at the root level, like app or auth just yet.

Is the error caused by dependencies (like zone.js for example) or by how I set up my store?

Redux DevTools 2.17.0

user776686
  • 7,933
  • 14
  • 71
  • 124

1 Answers1

0

Old question, but if it helps anyone - I had a the same error after upgrading an old app to use @ngrx/store to 4.1.1

I had to match @ngrx/store-devtools to the same version number as the other @ngrx deps.

npm had initially installed it at latest which was 8.x at time of writing. As soon as the deps were matched the app and store loaded fine

"@angular/core": "5.2.11",
...
"@ngrx/effects": "4.1.1",
"@ngrx/store": "4.1.1",
"@ngrx/store-devtools": "4.1.1",
....
"zone.js": "0.8.12"
Eugene
  • 211
  • 2
  • 9