No module factory available for dependency type: ContextElementDependency (after update 1.6.8 -> 1.7.0)
See original GitHub issueHaving a build error after update to 1.7.0
No module factory available for dependency type: ContextElementDependency
Versions
ng -v
Angular CLI: 1.7.0 Node: 8.9.1 OS: win32 x64 Angular: 5.2.5 … animations, common, compiler, compiler-cli, core, forms … http, language-service, platform-browser … platform-browser-dynamic, router
@ angular/cli: 1.7.0 @ angular-devkit/build-optimizer: 0.3.1 @ angular-devkit/core: 0.3.1 @ angular-devkit/schematics: 0.3.1 @ ngtools/json-schema: 1.2.0 @ ngtools/webpack: 1.10.0 @ schematics/angular: 0.3.1 @ schematics/package-update: 0.3.1 typescript: 2.4.2 webpack-dev-server: 2.9.7 webpack: 3.10.0
P.s.
- removing
node_modules
and reinstalling withnpm i
- didn’t help - trying to
npm i @angular/cli --save-dev
- didn’t help - downgrade to
1.6.8
- helped
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Angular No module factory available for dependency type
Steps I took to fix this problem in case if someone encounters it: Package.json: remove webpack from DevDependencies; rm -R node_modules ...
Read more >No module factory available for dependency type - Medium
I solved it by undoing one of the steps above i.e. the webpack 4 install since build-angular already includes webpack 4.
Read more >angular/angular-cli - Gitter
Hi all, is there a way to edit/update the ng e2e command to run both ng serve and then ng e2e so that...
Read more >if a add a module with routing module, ng serve will fail
these are errors: assets/scss/bootstrap/bootstrap.scss ✖ 「wdm」: Error: No module factory available for dependency type: ContextElementDependency ...
Read more >Angular Aucune fabrique de modules disponible pour le type ...
disponible pour type dépendance: ContextElementDependencyAngular Aucune ... No module factory available for dependency type: ContextElementDependency at ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
@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 indevDependencies
.Now after upgrading to RC 6 versions I’m getting exactly same
ContextElementDependency
error and removingwebpack
fromdevDependencies
simply causes theNodeTemplatePlugin
error again.I wonder what’s wrong here.