Closed webkingashu closed 7 years ago
Receiving the same error after following this post: https://medium.com/@evertonrobertoauler/angular-4-universal-app-with-angular-cli-db8b53bba07d
Yeap! The same error as here!
If i run "ng build" works fine, but when run "ng build --prod" it happens this error
FYI, add this to your package.json dependencies: "enhanced-resolve": "3.3.0",
and delete the node_modules folder, after that run npm install
again.
@suau thanks for reply but it didn't help in my case, I tried enhanced-resolve 3.3.0 (and 3.4.1) with and without deleting node_modules
@ahaw try updating to "@angular/cli": "1.2.4"
node_modules
package-lock.json
and delete it before running npm install
after npm install
go to node_modules/enhanced-resolve/package.json
and make sure it's version 3.3.0
@suau Thanks! It worked. The problem was no matter how I modified packages.json enchanced-resolve in version 3.4.1 was installed. I needed to delete it and manually type
npm install enhanced-resolve@3.3.0
This was fixed by the @angular/cli or the webpack folks, just update it by running npm install -g @angular/cli
, remove the node_module in the project and install the dependencies again and everything will work again.
Encountered error whille running npm run start
Tried angular universal official doc as well as this repo There is the issue of "import token" and here is this issue