Open kpambid opened 5 years ago
Upgrading to node 10.6 solved this problem.
I'm using node 10.15.3. But getting same error.
I'm using node 10.15.3. But getting same error.
Try downgrading to 10.6 if you could.
try
npm clean-install
after upgrading you npm version to 10. It worked for me and fixed the issue.
same issue here with vue/cli
on node@v10.15.3
which i got
<module class='export'>
<!-- ANY TAGs... -->
</module>
I was getting the same error when using ng-cli-pug-loader. The issue is with the file ng-add-pug-loader.js produced by the ng CLI schematics. The file runs on npm postinstall and adds an extra rule to the webpack common.js file.
The solution is to replace the following line in ng-add-pug-loader.js right after running ng add ng-cli-pug-loader
:
const pugRules = ' { test: /\.(pug|jade)$/, exclude: /\.(include|partial)\.(pug|jade)$/, use: [ { loader: "apply-loader" }, { loader: "pug-loader" } ] }, { test: /\.(include|partial)\.(pug|jade)$/, loader: "pug-loader" },';
with:
const pugRules = ' { test: /\\.(pug|jade)$/, exclude: /\\.(include|partial)\\.(pug|jade)$/, use: [ { loader: "apply-loader" }, { loader: "pug-loader" } ] }, { test: /\\.(include|partial)\\.(pug|jade)$/, loader: "pug-loader" },';
(note the additional escaping)
Version info:
Angular CLI: 9.1.1 Node: 13.12.0 Angular: 9.1.1
@alexprykhodko Thank you!
Just gonna add something: after replacing the config string, you have to make sure that this file:
node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/common.js
contains new, fixed config too, either by fixing it manually or reinstalling dependencies.
I encountered this error whenever using pug in my app. I've surely installed ng-cli-pug-loader and it's dependencies(pug, pug-loader, apply-loader) though. Any ideas?