question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No module factory available for dependency type: ContextElementDependency (after update 1.6.8 -> 1.7.0)

See original GitHub issue

Having 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.

  1. removing node_modules and reinstalling with npm i - didn’t help
  2. trying to npm i @angular/cli --save-dev - didn’t help
  3. downgrade to 1.6.8 - helped

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

43reactions
adujosephcommented, 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

18reactions
GeorgeKnapcommented, 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 ContextElementDependency error and removing webpack from devDependencies simply causes the NodeTemplatePlugin error again.

I wonder what’s wrong here.

@angular 6.0.0-rc.1
@angular/cli v6.0.0-rc.0
webpack 4.4.1


Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found