Hey team after update to ionic 5 my project is not working may be ngxs/store is going to reject? i am not sure where i am wrong but in runtime i am getting an error!
Unhandled Promise rejection: Can't resolve all parameters for InsiderState: (?, ?). ; Zone: <root> ; Task: Promise.then ; Value: Error: Can't resolve all parameters for InsiderState: (?, ?).
My package.json
{
"dependencies": {
"@angular/common": "~10.0.0",
"@angular/core": "~10.0.0",
"@angular/forms": "~10.0.0",
"@angular/platform-browser": "~10.0.0",
"@angular/platform-browser-dynamic": "~10.0.0",
"@angular/router": "~10.0.0",
"@ionic-native/core": "^5.0.0",
"@ionic/angular": "^5.0.0",
"@ngxs/devtools-plugin": "^3.7.1",
"@ngxs/logger-plugin": "^3.7.1",
"@ngxs/router-plugin": "^3.7.1",
"@ngxs/schematics": "0.0.1-alpha.5",
"@ngxs/storage-plugin": "^3.7.1",
"@ngxs/store": "^3.7.1",
"hammerjs": "^2.0.8",
"immer": "^8.0.0",
"node-sass": "^4.14.1",
"rxjs": "~6.5.5",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.0",
"@angular/cli": "~10.0.5",
"@angular/compiler": "~10.0.0",
"@angular/compiler-cli": "~10.0.0",
"@angular/language-service": "~10.0.0",
"@ionic/angular-toolkit": "^2.3.0",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.9.5"
},
}
This occurs because you are missing the @Injectable() tag between your @State and Class definition. For example
@State<InsiderStateModel>()
@Injectable()
export class InsiderState {
constructor() {}
}
This error becomes present when migrating to any angular 9+ projects.
Thanks @xavidram
Most helpful comment
This occurs because you are missing the @Injectable() tag between your @State and Class definition. For example
This error becomes present when migrating to any angular 9+ projects.