Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular ngrx store error Cannot read property 'schedule' of undefined

I tried to implement ngrx/Store with Angular but I am always getting the following error in console, and no content is showed:

"TypeError: Cannot read property 'schedule' of undefined at ObserveOnSubscriber.scheduleMessage"

By the way I am using:

Angular CLI: 1.7.4
Angular: 5.2.11

Since I am new to ngrx/Store I am trying to implement the following example: https://malcoded.com/posts/angular-ngrx-guide

Even I tried with other examples but I am getting always the same above mentioned error.

like image 770
Tigris Laesus Avatar asked Jun 06 '18 22:06

Tigris Laesus


1 Answers

I was facing same issue while integrating the ngRx/Store in a new application. When I checked the npm install log, I noticed this:

npm WARN @ngrx/[email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.

This lead me to believe that @ngRx/Store v6.x requires Angular v6. After uninstalling the @ngRx/Store v6 and downgrading to ngRx/Store v5.2.0, everything worked like a charm.

Solution in steps:

  1. npm uninstall @ngrx/store
  2. npm install @ngrx/store@5
  3. re-compile app

Added some more line due to edits restriction

like image 114
Syed Ali Taqi Avatar answered Sep 24 '22 04:09

Syed Ali Taqi