Over the past years, I came across so many weird issues while developing and most of them I couldn't find any mentions or articles or even any stac...
For further actions, you may consider blocking this person and/or reporting abuse
It seems that this error is caused by local install of package webpack under @angular-devkit when there is also an independent install under host package. I would guess that the code somehow uses files from node_modules\@angular-devkit\build-angular\node_modules\webpack and node_modules\webpack somewhat haphazardly which leads to this error.
Namely the constructor object in the dependencyTemplates-map is generated form one and the dependency.constructor for the other. Thus they are not the same object and subsequently the constructor is not found from map leading to all kinds of fun and games...
It seems that ensuring identical versions of webpack in both locations and then running npm dedupe ensures that there is only one install of webpack and thus prevents this error.
Wow, that is a nice explanation :), this will probably help others easier ^^
I didn't even knew about
npm dedupe
, nice to know 🎉Thank you. :)
npm prune
ornpm dedupe
didn't work work for me with Angular@11found this solution on SO: stackoverflow.com/a/68462360/4115894
npm i worker-plugin --save-dev
hello, i follow you advises, update node to version 12.13.1,,but i still met the problem,,can you give me more information?
Oh, I'm sorry you also having these weird issues ...
running
npm prune
was probably the one thing that "fixed it all" , did you ran that?Also did you tried the latest angular version?
If those tasks don't work, I'm out of ideas, since I had this issue only once and never since then :(