angular-cli: 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
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 8
- Comments: 44 (6 by maintainers)
@angular/cli 1.0.0-rc.0 still has same problem. 3 months passed and still we can’t use newest AOT to compile our projects that use
forRoot
static method to provide providers for root module. 😦any progress about this issue, we have the same problem.
Same here.
Steps to reproduce:
ng new test-app
foo.service.ts
insrc/app
with content:app.module.ts
:ng build --prod --aot
. The output is:For some reason the EventEmitter breaks the build. The following code compiles with angular 2.2.3, angular-cli 1.0.0-beta.22-1 and add the @ngtools/webpack@1.1.9 as dependency in package.json.
Reverting to
1.0.0-beta.19-3
like @alvachien mentioned fixes the issue for me. I also experimented with working backwards through versions and the first version that did not breakng build
for me is1.0.0-beta.21
.just to add my error into the mix:
ERROR in Error encountered resolving symbol values statically. Could not resolve events relative to /Users/…/node_modules/@types/mongodb/index.d.ts., resolving symbol Db in Users/…/node_modules/@types/mongodb/index.d.ts
Why is it going into mongodb when nothing in my client side code refs that module?