Previously my app was working with Angular 4.4.6. I followed the guide https://angular-update-guide.firebaseapp.com/ to update to Angular 5. I used this:
npm install @angular/animations@'^5.0.0' @angular/common@'^5.0.0' @angular/compiler@'^5.0.0' @angular/compiler-cli@'^5.0.0' @angular/core@'^5.0.0' @angular/forms@'^5.0.0' @angular/http@'^5.0.0' @angular/platform-browser@'^5.0.0' @angular/platform-browser-dynamic@'^5.0.0' @angular/platform-server@'^5.0.0' @angular/router@'^5.0.0' [email protected] rxjs@'^5.5.2'
But it didn't work. It would give me an error no valid target found for rxjs
. So instead, I simply changed the versions in my package.json and ran npm install
and it worked, but when running npm start, I get the error
WARNING in ./~/@angular/core/esm5/core.js
6456:15-102 Critical dependency: the request of a dependency is an expression
So I deleted my node_modules and did npm install once again, and I still get the same error when running npm start.
Screenshot:
I managed to solve it by changing the webpack.common.js with this:
new webpack.ContextReplacementPlugin(
/(.+)?angular(\\|\/)core(.+)?/,
root('./src'),
{}
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With