in 1.0.0-beta.24 getting ERROR in Error encountered resolving symbol values statically
OS?
Windows 10 64
Versions.
latest ng 2.4.1 and cli 1.0.0-beta.24
Repro steps.
Angular 2 Kitchen sink: http://ng2.javascriptninja.io and source@ https://github.com/born2net/Angular-kitchen-sink
ERROR in Error encountered resolving symbol values statically. Calling function 'MsLibModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in C:/msweb/Angular-kitchen-sink/src/app/app.module.ts, resolving symbol AppModule in C:/msweb/Angular-kitchen-sink/src/app/app.module.ts
webpack: bundle is now VALID.
I am loading a module with forRoot as in:
imports: [
...
MsLibModule.forRoot(),
...
],
which doens't do much,
export class MsLibModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: MsLibModule,
providers: []
};
}
}
as you can see no lambada needed... and still getting the error of:
ERROR in Error encountered resolving symbol values statically. Calling function 'MsLibModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in C:/msweb/Angular-kitchen-sink/src/app/app.module.ts, resolving symbol AppModule in C:/msweb/Angular-kitchen-sink/src/app/app.module.ts
regards
Sean
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.
If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.
Getting the same error with @angular-cli 1.2.1; is there an open issue for this? The app works fine when using ng serve, but breaks when I do ng build.
Hey @jaibatrik, just ran into this issue the other day as well. My issue was that I was trying to use the ui-router module and I was defining my state resolves with arrow functions. After some research I found out that the current version of ui-router that I'm using is not AOT compatible[1]. This was causing the Error encountered resolving symbol values statically to be thrown.
So I guess my advice is to check the filenames being listed in the error, and see if they all have something to do with a module you are using. This is probably the only way I figured my solution; my only other file that was throwing errors besides app.module.ts, was states.ts where I define my router states.
1: https://github.com/ui-router/angular/issues/29
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.