Coder Social home page Coder Social logo

Angular 7 about ng-cli-pug-loader HOT 21 CLOSED

danguilherme avatar danguilherme commented on June 9, 2024 2
Angular 7

from ng-cli-pug-loader.

Comments (21)

David-van-der-Sluijs avatar David-van-der-Sluijs commented on June 9, 2024 2

npm clean-install

worked for me and fixed the issue.

from ng-cli-pug-loader.

gabynevada avatar gabynevada commented on June 9, 2024 1

For me deleting the package for the commonCli config and then doing an npm install worked.

Apparently the old pug loader script changes were messing with the new one and it wasn't working correctly.

from ng-cli-pug-loader.

danguilherme avatar danguilherme commented on June 9, 2024

I have not tested it in Angular 7.
If someone else could report this I'd be more than happy!

from ng-cli-pug-loader.

adayrit avatar adayrit commented on June 9, 2024

Trying to update to Angular 7 and now seem to have an issue with pug files. On load the templates return 404 errors.

Assuming this would be an issue with CLI changes and the updates cli pug loader does to the webpack config during post install.

Anyone tried a Angular 7 update yet and have any pointers?

experiencing the same thing.

from ng-cli-pug-loader.

perrosen avatar perrosen commented on June 9, 2024

@danguilherme yeah would be super awesome. Happy to help if needed. Currently starting to come into some dependency issues and an upgrade to 7 would be really helpful :)

from ng-cli-pug-loader.

m-przybylski avatar m-przybylski commented on June 9, 2024

I tried to use library with my Angular 7 application. It works wine with JiT, but does not work with AoT. The project does not start, compiler does not report any problem it just stops building. It looks like process is killed by the system.
However when I put it into newly created project it works just fine.

from ng-cli-pug-loader.

danguilherme avatar danguilherme commented on June 9, 2024

I would be very happy to accept a PR!
Apparently not even Angular 8 is supported by this version. Will have to check, can't compromise with time now.

@m-przybylski:

However when I put it into newly created project it works just fine.

Could you elaborate on that?
You migrated your application from Angular 6 to 7, and the app does not work on AoT mode, but if you add the package on a newly created app (with v7), it works in both AoT and JiT?

from ng-cli-pug-loader.

raykin avatar raykin commented on June 9, 2024

I have a different problem on Angular7 with ionic4 and fixed in a workaround.
I've install pug-loader when the ionic serve(actually wrap ng serve) started and it success, but restart the ionic serve the pug file can not recognized any more.
I think the reproduce steps are:
The init state is 1. Install ionic globally and launch a new ionic project server. 2. which ng return not found.
Then I have to install angular-cli globally to have ng command to install the pug loader. At current state, I can use pug in previous launched server.
Then I restart the ionic server and it alerts pug file is not recognized.

I finally realize the pug loader add rules to local lib. Without angular-cli installed globally, ionic will run ng from local, but if the angular-cli installed, ionic will call ng from global. And ng serve from global doesn't have the rule inserted.
So in my case I uninstall angular-cli from global and the ionic serve works with pug template again.

Hope this case can help others too.

from ng-cli-pug-loader.

danguilherme avatar danguilherme commented on June 9, 2024

Great finding @raykin, thanks for sharing!

If I'm not mistaken, Angular CLI shows a warning when we're using a global installed ng instead of a local one - which means that the solution you described is the recommended way.

Maybe Ionic server just swallows that warning.

from ng-cli-pug-loader.

JoshuaNitschke avatar JoshuaNitschke commented on June 9, 2024

FYI, I was on Angular 7 (upgraded from Angular 6) without any issues.

from ng-cli-pug-loader.

gabynevada avatar gabynevada commented on June 9, 2024

Angular 8 is not working properly even after new update.
It gives this error on the console

Uncaught Error: Template parse errors:
'module' is not a known element:
1. If 'module' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

Any ideas on how to fix it?

from ng-cli-pug-loader.

JoshuaNitschke avatar JoshuaNitschke commented on June 9, 2024

from ng-cli-pug-loader.

gabynevada avatar gabynevada commented on June 9, 2024

I tried npm install, it runs the post install script but the same error pops up after I run ng serve.

I also tried to npm uninstall the module as it doesn't update the ng-add-pug-loader.js script when you install the latest version, even after making sure I had the latest version installed, the correct script and doing npm install I still get the same error.

from ng-cli-pug-loader.

JoshuaNitschke avatar JoshuaNitschke commented on June 9, 2024

from ng-cli-pug-loader.

gabynevada avatar gabynevada commented on June 9, 2024

from ng-cli-pug-loader.

JoshuaNitschke avatar JoshuaNitschke commented on June 9, 2024

from ng-cli-pug-loader.

usman-vqode avatar usman-vqode commented on June 9, 2024

Using node 10.16 here and still getting the same error on Angular 8. Any solutions found for this?

from ng-cli-pug-loader.

gabynevada avatar gabynevada commented on June 9, 2024

I got node 10.16.

  • If I create a new Angular 8 project, it works fine.
  • If I upgrade just the ng-cli-pug-loader on my angular 7 project it stops working and gives back the prior 'module' is not a known element error.
  • If I upgrade existing project to Angular 8 and upgrade ng-cli-pug-loader it errors out as well.

from ng-cli-pug-loader.

perrosen avatar perrosen commented on June 9, 2024

@gabynevada What was the package you deleted? Currently running into the "'module' is not a known element:" on an Angular 8 project that has been updated from 7.

from ng-cli-pug-loader.

perrosen avatar perrosen commented on June 9, 2024

@gabynevada Never mind. A clean npm i sorted it for me.

from ng-cli-pug-loader.

danguilherme avatar danguilherme commented on June 9, 2024

This project is no longer maintained. Check out ngx-pug-builders to add support to pug files to the latest versions of Angular.

from ng-cli-pug-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.