Compiling error saying ' Types of property 'declarations' are incompatible.'
daituzhang opened this issue · 1 comments
daituzhang commented
Hi,
Sorry that I'm really new to the ngrx.
I'm trying to just make the example on the readme work.
But I get the error at compiling time
Types of property 'declarations' are incompatible.
Type '(typeof AppComponent | typeof PrintComponent | ModuleWithProviders)[]' is not assignable to type '(any[] | Type<any>)[]'.
Type 'typeof AppComponent | typeof PrintComponent | ModuleWithProviders' is not assignable to type 'any[] | Type<any>'.
Type 'ModuleWithProviders' is not assignable to type 'any[] | Type<any>'.
Type 'ModuleWithProviders' is not assignable to type 'Type<any>'.
Property 'apply' is missing in type 'ModuleWithProviders'.```
I'm using
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@ngrx/core": "^1.2.0",
"@ngrx/store": "^2.2.3",
"core-js": "^2.4.1",
"rxjs": "^5.4.2",
"@angular/cli": "1.1.0",
"@angular/compiler-cli": "^4.0.0",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
Is there any reason causing it?
I saw couple threads that mention that there are some issues with ngrx 5.4.2. Is it what it is?
What version of ngrx and typescript can make it work?
Thank you
brandonroberts commented
It means you have something in your declarations
array that shouldn't be there. StoreModule.provideStore
should go in your imports
array