Description
I'm having this error after updating to latest angular-cli 1.0.0-beta.24,
using angular v2.3.1 and angular-cli 1.0.0-beta.21 works but when updating the cli to 1.0.0-beta.24 I get that error in compilation but the app seems to work OK.
Steps to reproduce:
Using latest angular-cli create a new project ng new new-test-project
.
then install latest ui-router-ng2 (1.0.0-beta.3).
edit app.module.ts with the import:
import { UIRouterModule } from 'ui-router-ng2';
...
@NgModule({
providers: [],
declarations: [AppComponent],
bootstrap: [AppComponent],
exports: [UIRouterModule],
imports: [
HttpModule,
FormsModule,
BrowserModule,
UIRouterModule
]
})
this will result in the error in the title:
ERROR in UIRouterModule is not an NgModule
using the forRoot like this:
imports: [
HttpModule,
FormsModule,
BrowserModule,
UIRouterModule.forRoot()
]
the error changes to this:
ERROR in Error encountered resolving symbol values statically. Calling function 'UIRouterModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in /path/to/new-test-project/src/app/app.module.ts, resolving symbol AppModule in /path/to/new-test-project/src/app/app.module.ts
in both cases the app is compiled with that error and the error also thrown in browser but the app seems to work.
$ ng version
angular-cli: 1.0.0-beta.24
node: 7.3.0
os: linux x64
@angular/common: 2.4.1
@angular/compiler: 2.4.1
@angular/core: 2.4.1
@angular/forms: 2.4.1
@angular/http: 2.4.1
@angular/platform-browser: 2.4.1
@angular/platform-browser-dynamic: 2.4.1
@angular/router: 3.4.1
@angular/compiler-cli: 2.4.1