Closed adwd closed 7 years ago
I noticed same problem and after npm i enhanced-resolve@3.3.0
I can build with AOT
Same problem here
@mchmielarski That's a very nice guess 👍
Same here.
workaround: npm install enhanced-resolve@3.3.0
thanks for the solution guys, this problem just cost us the whole morning.
adding enhanced-resolve@3.3.0
solved it.
Thx, same here.
enhanced-resolve@3.3.0
solved the issue.
The same here!
enhanced-resolve@3.3.0 solved it!
thanks god for this issue, i fixed this problem the whole day
Workaround with "enhanced-resolve@3.3.0" seems to work on Mac OS but not on Linux!? Can anyone confirm this behavior?
works on linux ubuntu 16.04 for me
Same issue.
Guys, you should really use fixed dependency versions for Angular-Cli. It's been a millionth time when everything breaks because in new versions of sub dependencies there is something unexpected...
The angular-cli version is already fixed for us which is 1.3.1 but still we have this error.
Same issue for me. Resolved with enhanced-resolve@3.3.0
on Ubuntu Server.
RIP the first 2 hours of my morning.
It worked for me too with 3.3.0.
Still we have error in AOT even with 3.4.1. Also in development the environment.ts is not overwritten with the appropriate environment file
This breaks all builds, amazing fun was had today! PLZ PLZ PLZ move to fixed dependency.
Issue still exists withenhanced-resolve@3.4.1
here. Same issue showing up.
Staying at 3.3.0 for now.
When creating new project with fresh installed angular/cli 1.2.0 fails, too :( I used yarn for package management.
Same problem here. npm install enhanced-resolve@3.3.0
resolved the issue for me temporarily, but only when it's installed as an addition into an already up and running project. Deployment through a fresh install with npm install
with this dependency set in package.json
does not work.
This is a major bug, because it breaks a running deployment pipeline and with it the whole production setup.
I'm on windows and adding enhanced-resolve@3.3.0
doesn't work for me.
@mscherer82 Did you run npm install
? If you did, you can try deleting node_modules
and re-running it. It worked for me.
@angelnikolov yes, I deleted node_modules
and reinstalled all packages.
Hm, can you try running npm ls
and see if this is your enhanced-resolve
version
+-- enhanced-resolve@3.3.0
@pvanhemmen You should install enhanced-resolve after npm install. As temporary resolve it's ok.
@vicetjs That's what I did and the only way it works for me, too. Thanx for your help!
In order to make my build server happy I forked angular/ngtools-webpack-builds and pinned enhanced-resolve
at 3.3.0
, then forked angular/cli-builds to point it at my ngtools
fork. If anyone is interested they can try it out by changing their package.json
to "@angular/cli": "github:benelliott/cli-builds#24a8837"
(note however that both libraries will be at master, not a specific version).
@pvanhemmen I was able to get deployment via fresh install working again by using npm shrinkwrap
after installing enhanced-resolve@3.3.0
. This got my Jenkins build pipeline working fine again
This should also prevent upstream dependency breakage from harming my project in the future :)
@bmcswee Awesome, thanx for the tip!
npm list
gave me:
+-- @angular/cli@1.2.3
| +-- @ngtools/json-schema@1.1.0
| +-- @ngtools/webpack@1.5.2
| | +-- enhanced-resolve@3.4.1
...
| +-- webpack@2.4.1
...
| | +-- enhanced-resolve@3.4.1 deduped
...
+-- enhanced-resolve@3.3.0
Installing enhanced-resolve 3.3.0 did the trick thank you!
Enhanced-resolve@3.3.0 did the trick for my project. Can somebody please explain me what this package does?
https://github.com/angular/angular-cli/issues/4551 regression from months ago.
@jakeNiemiec This means I should uninstall the package at a later point in time, when the Angular team fixes the bug, right?
Cheers!
Guys, the enhanced-resolve@3.3.0
way-around doesn't work on my project. I still have the same error. Is there any update on this issue?
@andreasonny83 did you run exactly this command:
npm i enhanced-resolve@3.3.0
Make sure to update Angular CLI and Node as well.
Just to be clear (@kasperfp, @andreasonny83):
❌ Won't work (this is what
npm@^5
put in my package.json
when I ran npm i enhanced-resolve@3.3.0
):"enhanced-resolve": "^3.3.0"
,✅ Will Work:
"enhanced-resolve": "3.3.0",
See more complete comment by @Gustorn below: https://github.com/angular/angular-cli/issues/7113#issuecomment-317483817
jakeNiemiec comment worked for me too. Is there any fix planned for this breaking change?
Hi all,
This seems to be a bug/breaking change in enhanced-resolve
, a dependency of webpack
. Will try to talk to the Webpack maintainers about this.
Meanwhile pin it to "enhance-resolve": "3.3.0"
in your package.json
.
Edit: issue on enhanced-resolve
is https://github.com/webpack/enhanced-resolve/issues/98.
@filipesilva Worth noting that it is also a direct dependency of @ngtools/webpack
.
@benelliott good point.
@lsunkara AFAIK that will result in a non-aot build which might not be desirable for everyone.
@warmans is correct. Please see https://github.com/angular/angular-cli/wiki/build#--dev-vs---prod-builds for effect of the --prod
flag.
@bmcswee :+1: I am adding shrinkwrap --dev to all things now. Just takes a bit more discipline, tired of all these breaking changes on npm packages. So that is a great tip to all.
@warmans, I agree, ng build --env=prod is not desirable. Pinning to enhanced-resolve to 3.3.0 only works. Thanks.
Relevant issues in the enhance-resolve
repo:
Changes since 3.3.0.
Nothing fixes this error for me. Already tried everything writen in this thread.
If anybody did something different please let me know!
@renatop7 I think some of the workaround suggestions here won't actually save the proper version in your package.json
. Here's how I fixed it:
enhanced-resolve
from your package.json
(if you already have some from other workarounds)npm i -DE enhanced-resolve@3.3.0
(-DE
should work consistently between npm4 and npm5)node_modules
folder to verify that it works with a clean installnpm install
, then run the production buildEdit: Also if you're using npm5
I'd try regenerating package-lock.json
(just delete it before step 4). I don't think this applies to too many people, the build shouldn't have even broken if you have a lockfile.
@Gustorn's that's a very good step by step guide, thanks!
@gustorn I also had to clear my npm cache to get the right version.
Bug Report or Feature Request (mark with an
x
)Versions.
Repro steps.
The log given by the failure.
Desired functionality.
aot build runs
Mention any other details that might be useful.
Maybe, enhanced-resolve 3.4.0 is cause. https://github.com/webpack/enhanced-resolve/issues/98
ng build --prod
runs successfully afternpm i enhanced-resolve@3.3.0
.