You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No module factory available for dependency type: ContextElementDependency (after update 1.6.8 -> 1.7.0) #9680
Same issue here after migrating from 1.6.6 to 1.7.0:
23% building modules 110/122 modules 12 active ...\kendo-angular-upload\dist\es\main.js
An error occured during the build:
Error: No module factory available for dependency type: ContextElementDependency
@filipesilva
Hi, I've seen your explanation over and over but I haven't been able to build app without explicitly installing webpack in my devDependencies since cli version 1.6 or so.
Without webpack I've been getting this error Cannot find module 'webpack/lib/node/NodeTemplatePlugin'.
That was always fixed by having webpack in devDependencies.
Now after upgrading to RC 6 versions I'm getting exactly same ContextElementDependency error and removing webpack from devDependencies simply causes the NodeTemplatePlugin error again.
Reacted by bluefire2121, 塟愛鎵镞de栤仯, an.chmelev, Jacob Amrany, Mahendra M. Kavathiya, Serg Kondrashov, Maciej Łodygowski, davyvanlaere, William Lahti, Florian Gareis and 8 more
I have the same issue.
I've search for solutions and uninstall webpack from my project.
When I run the command : ng serve, I have another one: Cannot find module webpack.
This works just fine for me with angular 6:
remove webpack from DevDependencies in Package.json
rimraf node_modules/ (remove node_modules folder)
rimraf package-lock.json (remove package-lock.json file)
npm install -g webpack (install webpack globally)
npm install -g webpack-dev-server
npm install
ng serve or ng build
Reacted by Rastislav Bodorík, buratinodev, Monika, Bill Barni, Thiago Silva, Elron, Roman Nesterov, cin3rama, Arash Sahami, Anastasia Tarasova and 23 more
Reacted by cin3rama, beyondtheobservableuniverse, GridCell, José Cunha Fonte, glemiere, Tiago Boeing and Eythan Fellous
Reacted by Tiago Boeing, sofyann and Eythan Fellous
angular-automatic-lock-bot commented on Sep 8, 2019
Activity
AndreyYevtukhov commentedon Feb 19, 2018
Error in npm's
debug.logPatrick-Kan commentedon Feb 19, 2018
same here. ng serve then ctrl - c then run ng-serve throw error port 4200 is in use.
lnu commentedon Feb 20, 2018
Same issue here after migrating from 1.6.6 to 1.7.0:
RomainMarecat commentedon Feb 20, 2018
I had the same issue with LazyLoading routing feature difference and angular-cli 1.6.8 -> 1.7.0
amcdnl commentedon Feb 20, 2018
Same issue here. Made no changes and upgraded and got the same error.
Versions:
amcdnl commentedon Feb 22, 2018
Tested on 1.7.1 and still happening :(
filipesilva commentedon Feb 22, 2018
Heya, this issue is a duplicate of #6417. You can see the answer to it in #6417 (comment).
The short version is that you can't have multiple versions of webpack on your node_modules. Removing the extra webpack installs should fix it.
amcdnl commentedon Feb 22, 2018
This was happening for me because I had storybook installed which comes with its own webpack version.
GeorgeKnap commentedon Apr 3, 2018
@filipesilva
Hi, I've seen your explanation over and over but I haven't been able to build app without explicitly installing webpack in my devDependencies since cli version 1.6 or so.
Without webpack I've been getting this error
Cannot find module 'webpack/lib/node/NodeTemplatePlugin'.That was always fixed by having webpack in
devDependencies.Now after upgrading to RC 6 versions I'm getting exactly same
ContextElementDependencyerror and removingwebpackfromdevDependenciessimply causes theNodeTemplatePluginerror again.I wonder what's wrong here.
davyvanlaere commentedon Jun 4, 2018
I have the exact same issue with the NodeTemplatePlugin error. The only way to fix is is by installing a higher webpack version ...
AlaaAhmedBM commentedon Aug 1, 2018
Do anyone get a solution to this error?
yzini-eagle commentedon Aug 2, 2018
@AlaaAhmedBM try this answer just remove the package-lock.json before npm install it worked for me!
redplane commentedon Aug 4, 2018
I have the same issue.
I've search for solutions and uninstall
webpackfrom my project.When I run the command :
ng serve, I have another one:Cannot find module webpack.Its very annoying.
redplane commentedon Aug 4, 2018
@yzini-eagle , seeing your solution. What I have tried is :
node_modules.package-lock.json.npm cache clean --forcenpm installIt worked. However, I don't know what the root cause is.
adujoseph commentedon Aug 15, 2018
This works just fine for me with angular 6:
remove webpack from DevDependencies in Package.json
rimraf node_modules/ (remove node_modules folder)
rimraf package-lock.json (remove package-lock.json file)
npm install -g webpack (install webpack globally)
npm install -g webpack-dev-server
npm install
ng serve or ng build
angular-automatic-lock-bot commentedon Sep 8, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.