Reputation: 4251
I am trying to migrate from Angular 8 to Angular 9 and getting below error on step: Undecorated classes with DI migration.
Could not migrate all undecorated classes that use dependency injection. Some project targets could not be analyzed due to TypeScript program failures.
Error: error TS100: src\app\app.module.ts(107,25): Error during template compile of 'AppModule' Function calls are not supported in decorators but 'combineReducers' was called in 'appReducers' 'appReducers' references 'modelReducer' at src\app\store\reducers\index.ts(13,10) 'modelReducer' calls 'combineReducers' at src\app\store\reducers\model.ts(25,29).
Any idea why I am getting this error?
Upvotes: 2
Views: 1678
Reputation: 12970
You more than likely need to decorate any classes that are using DI with @Injectable()
ex:
@Injectable()
class MyClass {
constructor(someService: SomeService) {...}
}
I personally am holding off on working with 9 until it's GA (due to previous experiences with major releases). But, "DI" and "undecorated classes" screams "you're missing the Injectable decorator" to me.
Are you going from 8.x to 9?
Upvotes: 1