Skip to content
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

No provider for singleton effects service #29

Closed
axtho opened this issue May 26, 2017 · 1 comment
Closed

No provider for singleton effects service #29

axtho opened this issue May 26, 2017 · 1 comment

Comments

@axtho
Copy link

axtho commented May 26, 2017

Including the nightly builds into an app that used the 2.x branch results in the following console error(s):

polyfills.bundle.js:10977 Unhandled Promise rejection: No provider for SingletonEffectsService! ; Zone: <root> ; Task: Promise.then ; Value: Error: No provider for SingletonEffectsService!

My setup is that I have a core module (which includes the entire ngrx stuff) that I yarn link into a web and mobile project. For core: ngc -p tsconfig.json compiles successfully (config similar to web - see below).
For web: ng serve --proxy-config proxy.conf.json compiles properly also.

The issue appears on the first load, where it checks for authentication (using effects).

I know it is hardly alpha status ... maybe it helps.
Btw: I followed the migration guide.

node: 7.8.0
os: darwin x64
Typescript: 2.3.3

@angular/cli: 1.0.6
@angular/animations: 4.1.3
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/flex-layout: 2.0.0-rc.1
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/material: 2.0.0-beta.6-1fce545
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.6
@angular/compiler-cli: 4.1.3
@angular/platform-server: 4.1.3

tsconfig:

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "baseUrl": "src",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "types": [
      "tinymce"
    ],
    "lib": [
      "es2016",
      "dom"
    ],
    "paths": {
      "@angular/common": ["../node_modules/@angular/common"],
      "@angular/compiler": ["../node_modules/@angular/compiler"],
      "@angular/compiler-cli": ["../node_modules/@angular/compiler-cli"],
      "@angular/core": ["../node_modules/@angular/core"],
      "@angular/http": ["../node_modules/@angular/http"],
      "@angular/router": ["../node_modules/@angular/router"],
      "@angular/platform-browser": ["../node_modules/@angular/platform-browser"],
      "@ngrx/effects": ["../node_modules/@ngrx/effects"],
      "@ngrx/store": ["../node_modules/@ngrx/store"],
      "@ngrx/router-store": ["../node_modules/@ngrx/router-store"],
      "@types/node": ["../node_modules/@types/node"],
      "ng2-webstorage": ["../node_modules/ng2-webstorage"],
      "rxjs": ["../node_modules/rxjs"],
      "tslint": ["../node_modules/tslint"],
      "zone.js": ["../node_moduleszone.js"]
    }
  }
}
@axtho
Copy link
Author

axtho commented May 26, 2017

Blimey ... following the docs under "docs" is indeed helpful ... forgot the .forRoot() import of EffectsModule. So in my case I import these three after another:

imports: [
    EffectsModule.forRoot(),
    EffectsModule.run(PersonEffects),
    EffectsModule.run(AuthEffects),
...
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant