-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compiler
Milestone
Description
🐞 bug report
Affected Package
"@angular/core": "^9.1.2",
Is this a regression?
Yes fine in Angular 8.2.14
Description
I am trying to upgrade, However I am stuck due to the following error in my terminal:

I've been following all the steps, using https://update.angular.io/#8.0:9.0. but for some reason I cannot resolve this issue.
I had looked at this issue and worked out where the problem, line, is in my app.module.ts.
ApiModule.forRoot()
if I remove forRoot(), the error has gone but I need the forRoot().
Thanks
api.module.ts:
@NgModule({
declarations: [],
imports: []
})
export class ApiModule {
// We need to use forRoot to match with the dev API module.
public static forRoot(): ModuleWithProviders< ApiModule > {
return {
ngModule: ApiModule,
providers: [
{
provide: JWT_OPTIONS,
useValue: {}
},
JwtHelperService,
GxAssuranceApiService,
CustomersApiService,
FoldersApiService,
OrdersApiService,
ProductsApiService,
SitesApiService,
SystemStatusApiService,
UsersApiService,
RefDataApiService
]
};
}
}
🔥 Exception or Error
ERROR in src/app/app.module.ts:79:12 - error NG1010: Value at position 6 in the NgModule.imports of AppModule is not a reference: [object Object]
79 imports: [
~
80 /**
~~~~~~~
...
166 })
~~~~~~
167 ],
~~~
🌍 Your Environment
Angular Version:
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.901.1
@angular-devkit/build-angular 0.901.1
@angular-devkit/build-optimizer 0.901.1
@angular-devkit/build-webpack 0.901.1
@angular-devkit/core 9.1.1
@angular-devkit/schematics 9.1.1
@angular/cdk 9.2.1
@angular/cli 9.1.1
@ngtools/webpack 9.1.1
@nguniversal/common 9.1.0
@nguniversal/express-engine 9.1.0
@schematics/angular 9.1.1
@schematics/update 0.901.1
rxjs 6.5.5
typescript 3.8.3
webpack 4.42.0
Anything else relevant?
#36271
This helped in identifying that the error is to do with the forRoot() but I cannot find a solution in my case.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compiler