Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error in webpack compiling

I've got an error while I'm trying to run my angular2 project. It occured after switching from PC with ubuntu to MacOS X. Node version: 7.7.4, npm version: 4.1.2. I'm running npm webpack-dev-server --inline --progress --watch --port 8180 and then I'm getting this information:

WARNING in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
69:15-36 Critical dependency: the request of a dependency is an expression

WARNING in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
85:15-102 Critical dependency: the request of a dependency is an expression

WARNING in ./~/angular2-focus/~/@angular/core/@angular/core.es5.js
5889:15-36 Critical dependency: the request of a dependency is an expression

WARNING in ./~/angular2-focus/~/@angular/core/@angular/core.es5.js
5905:15-102 Critical dependency: the request of a dependency is an expression

ERROR in [default] /Users/user/Documents/Java/WORK/mediahelper/media-helper/src/main/web/node_modules/angular2-focus/node_modules/@angular/core/src/animation/animation_metadata_wrapped.d.ts:12:32 
Initializers are not allowed in ambient contexts.

[...]

ERROR in [default] /Users/user/node_modules/@types/core-js/index.d.ts:651:4 
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] /Users/user/node_modules/@types/core-js/index.d.ts:666:4 
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] /Users/user/node_modules/@types/core-js/index.d.ts:680:4 
All declarations of 'prototype' must have identical modifiers.

ERROR in [default] /Users/user/node_modules/@types/core-js/index.d.ts:692:4 
All declarations of 'value' must have identical modifiers.

ERROR in [default] /Users/user/node_modules/@types/core-js/index.d.ts:804:4 
All declarations of 'prototype' must have identical modifiers.
like image 673
TomOw Avatar asked May 22 '26 08:05

TomOw


1 Answers

Just updated my pet project to @angular4 and got similar warnings

angular/core.es5.js 5889:15-36 Critical dependency: 
the request of a dependency is an expression

Change your webpack.conf.js

from: /angular(\|/)core(\|/)(esm(\|/)src|src)(\|/)linker/
to:   /angular(\|/)core(\|/)@angular/

Link to reddit thread: https://www.reddit.com/r/Angular2/comments/6160c2/angular_400_now_available/dfci3gm/

like image 107
Andrew Kravchuk Avatar answered May 23 '26 22:05

Andrew Kravchuk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!