Solveduniversal starter Error: No module factory available for dependency type: ContextElementDependency
netlander posts at
13 Answers
Share
Original✔️Accepted Answer
You can get this working off a project that has webpack
already installed by doing:
1.npm ls webpack
you should have the output
ng-universal-demo@0.0.0 /home/fabian/Documents/universal-starter
├─┬ @angular-devkit/build-angular@0.6.0
│ └── webpack@4.6.0
└── webpack@4.8.1
npm uninstall webpack
thennpm ls webpack
This will uninstall all copies of webpack so the output should be
fabian@fabian-desktop:~/Documents/universal-starter$ npm ls webpack
ng-universal-demo@0.0.0 /home/fabian/Documents/universal-starter
└── (empty)
- Remove package-lock.json and node_modules then
npm install
and finallynpm ls webpack
Which should then have the output
fabian@fabian-desktop:~/Documents/universal-starter$ npm ls webpack
ng-universal-demo@0.0.0 /home/fabian/Documents/universal-starter
└─┬ @angular-devkit/build-angular@0.6.0
└── webpack@4.6.0
If successful then you can test it with npm run build:ssr
if this succeeds then you're golden.
As an alternative you can simply edit your package.json to remove webpack, then remove your package-lock.json and node_modules then do a npm install
and you should be good to go
I understand your frustration but I only have so much time in a day to maintain things around here.
I've investigated this issue and the solution i've provided is the best that's currently available.
Related Issues:
36
universal starter How to deploy Angular Universal to production (port 80)
The @kalyan1102 answer is correct After make the app how to deploy it? I see that on package.json th...
13
universal starter Can't get current request (or more specifically cookies)
Fixed by adding empty array to deps for the provider: Hi again ! Going deeper and deeper in the use ...
13
universal starter Error: No module factory available for dependency type: ContextElementDependency
You can get this working off a project that has webpack already installed by doing: 1.npm ls webpack...
11
universal starter How add a translate module to universal starter?
So I lost half a day figuring out how to use ngx-translate with universal-starter therefore find out...
6
universal starter not implemented in Parse5DomAdapter: getElementsByTagName
Okay just in case anyone else lands here and needs this Hi I may be running away with things that ar...
3
universal starter How to set meta data in index.html
@nicky-lenaers My solution should work on server-side at leats it works for me Here i have seen angu...
This error shows on a fresh install of 6.0.0 (
npm i && ng serve
):