Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'module' is not a known element error #120

Open
kpambid opened this issue Apr 11, 2019 · 7 comments
Open

'module' is not a known element error #120

kpambid opened this issue Apr 11, 2019 · 7 comments

Comments

@kpambid
Copy link

kpambid commented Apr 11, 2019

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?
Screen Shot 2019-04-11 at 6 25 33 PM

@kpambid
Copy link
Author

kpambid commented Apr 11, 2019

Upgrading to node 10.6 solved this problem.

@kiseyob
Copy link

kiseyob commented May 15, 2019

I'm using node 10.15.3. But getting same error.

@kpambid
Copy link
Author

kpambid commented May 17, 2019

I'm using node 10.15.3. But getting same error.

Try downgrading to 10.6 if you could.

@David-van-der-Sluijs
Copy link

try

npm clean-install

after upgrading you npm version to 10. It worked for me and fixed the issue.

@cdll
Copy link

cdll commented Feb 5, 2020

same issue here with vue/cli on [email protected] which i got

<module class='export'>
  <!-- ANY TAGs... -->
</module>

@alexprykhodko
Copy link

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

@autaut03
Copy link

autaut03 commented Sep 9, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants