angular-cli: @ngtools/webpack - Error encountered resolving symbol values statically
Versions.
- angular@2.3.1
- @ngtools/webpack@1.2.1
- webpack@2.1.0-beta.28
Repro steps.
Not really repro steps, but the not-changed webpack config used to work with angular@2.2.4 and @ngtools/webpack@1.1.9, since upgrading I get the error described below and I have no idea what to do about it.
The log given by the failure.
ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AnimationDriver in /Users/ajantsch/Dropbox/Projects/22_9Cookies/transmission-web-client/webkick/node_modules/@angular/platform-browser/src/dom/animation_driver.d.ts, resolving symbol BrowserTestingModule in /Users/ajantsch/Dropbox/Projects/22_9Cookies/transmission-web-client/webkick/node_modules/@angular/platform-browser/testing/browser.d.ts, resolving symbol BrowserTestingModule in /Users/ajantsch/Dropbox/Projects/22_9Cookies/transmission-web-client/webkick/node_modules/@angular/platform-browser/testing/browser.d.ts
ERROR in ./src/bootstrap.ts
Module not found: Error: Can't resolve './../$$_gendir/src/app/main.module.ngfactory' in '/Users/ajantsch/Dropbox/Projects/22_9Cookies/transmission-web-client/webkick/src'
@ ./src/bootstrap.ts 3:0-83
ERROR in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
Module not found: Error: Can't resolve '/Users/ajantsch/Dropbox/Projects/22_9Cookies/transmission-web-client/webkick/$$_gendir' in '/Users/ajantsch/Dropbox/Projects/22_9Cookies/transmission-web-client/webkick/node_modules/@angular/core/src/linker'
@ ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 69:15-36 85:15-102
@ ./~/@angular/core/src/linker.js
@ ./~/@angular/core/src/core.js
@ ./~/@angular/core/index.js
@ ./src/bootstrap.ts
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 33
- Comments: 77 (6 by maintainers)
This Angular-cli is completely not ready for working with it…
Please, someone help us.
Why is this issue marked as close? the error message still appears after upgrading to beta 30 with AOT build.
I’m still getting this issue when running
ng build --aot --prod
Using angular-cli version beta25.5 (Recent upgrade, removed node_modules, ran ng init).Also on ng build -prod --aot
agreed…
I just ran into this problem, installing all the latest dependencies, and trying to run
ng serve --prod --aot
today. This should be reopened.I managed to make it work after getting the same error:
error in this.symbolResolver.getSymbolByModule is not a function webpack: Failed to compile.
I used this command to update all the packages
npm update -D && npm update -S
(source) did this 2-3 times and my app ran without any problems (ng serve).@Yamilquery we got the same error today. We had angular 4.0.1 libraries with angular/cli 1.0.0-rc.2 in our package.json.
angular/cli 1.0.0-rc.2 getting the latest version of angular/compiler-cli according its dependencies. (4.0.2 at this moment). And angular/compiler-cli 4.0.2 has angular/compiler 4.0.2 in peerDependencies, but it was not installed.
So, in our case update from angular 4.0.1 to 4.0.2 solved this error.
Keep getting this error with ng serve:
ERROR in this.symbolResolver.getSymbolByModule is not a function
with angular and angular/cli latest version. Since my project relies on primeng ultima template, I’m Trying to keep my project as close as possible to ultima demo project, which compiles correctly whereas mine doesn’t.
I’m getting a similar error:
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '[...]/src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts
my error is:
latest everything…
project: https://github.com/born2net/studioDashboard
Something similar for me after upgrading
ERROR in Error encountered resolving symbol values statically. Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler (position 79:22 in the original .ts file), resolving symbol AUTH_PROVIDERS in C:/Xacte2/XacteUI-D/node_modules/angular2-jwt/angular2-jwt.d.ts, resolving symbol AppModule in C:/Xacte2/XacteUI-D/src/app/app.module.ts, resolving symbol AppModule in C:/Xacte2/XacteUI-D/src/app/app.module.ts
Help, I’m getting the same…
Nativescript It has been a headache!
In the morning it worked perfect and suddenly stopped working …
I had this error when in appModule was
{ path: "work", loadChildren: "/modules/social/work/WorkModule#WorkModule" }
angular-cli beta-24 ng build and serve error at finish but dist directory creates:
Hash: 5e16130df6044b0b8bb7
Time: 26102ms chunk {0} main.f9a9d29d3531b5bb577d.bundle.js, main.f9a9d29d3531b5bb577d.bundle.map (main) 18.7 kB {2} [initial] [rendered] chunk {1} styles.4a4db805ac49f2977add.bundle.css, styles.4a4db805ac49f2977add.bundle.map, styles.4a4db805ac49f2977add.bundle.map (styles) 1.69 kB {3} [initial] [rendered] chunk {2} vendor.721d51ad17cc097115fc.bundle.js, vendor.721d51ad17cc097115fc.bundle.map (vendor) 3.28 MB [initial] [rendered] chunk {3} inline.3ee6c85492759d2c86ad.bundle.js, inline.3ee6c85492759d2c86ad.bundle.map (inline) 0 bytes [entry] [rendered]
ERROR in this.symbolResolver.getSymbolByModule is not a function
@SirBrecilos Running the command:
npm update -D && npm update -S
solved it for me. Thanks!
I’m still back on angular2, all I had to do was add the
@angular/compiler-cli
dependency to match the version of my@angular/compiler
to fix this.Same issue. Can this at least be dropped to a Warning so that my build process can continue? Everything appears to work fine despite this error.
Same issue here when importing an npm linked module. Using “angular-cli”: “1.0.0-beta.24”, @angular/*/2.4.4
With
ng build --aot
I also get a similar error:As many, I was exposed after an ugrade to the message
ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function,.....
My cause was in the reducers, who worked perfectly with 2.3 The solution was to replace
export const myReducer: ActionReducer<string> = function(state: string = "pipo", action: Action){
byexport function myReducer(state: string = "pipo", action: Action){
I hope it help getting from the hole I was stuck in for quite a few hours… Alex@ajantsch that did the trick. I’m using the same helper method elsewhere in my webpack config but completely overlooked adding it to those paths in the plugin’s options.
thanks!
@bellizio unfortunately not, the only thing I do differently is that I use a helper function that creates the path-string.
any solution for this issue. I have same issue. here is how i am using AOTPlugin
Same error here:
About my problem (Could not resolve “app/+home/home.module” from “/src/app/app.module.ts”). I changed the routing
FROM: export const routes: Routes = [ { path: ‘’, component: MainLayoutComponent, children: [ { path:‘’, children: [ { path: ‘home’, loadChildren: ‘app/+home/home.module#HomeModule’ }] } ] } ];
TO:
export const routes: Routes = [ { path: ‘’, component: MainLayoutComponent, children: [ { path:‘’, children: [ { path: ‘home’, loadChildren: ‘./+home/home.module#HomeModule’ }] } ] } ];