danguilherme / ng-cli-pug-loader

:sparkles: Angular schematics to add .pug to your project
GNU General Public License v3.0
56 stars 17 forks source link

Angular 7 #19

Closed perrosen closed 11 months ago

perrosen commented 5 years ago

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?

danguilherme commented 5 years ago

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

adayrit commented 5 years ago

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.

perrosen commented 5 years ago

@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 :)

m-przybylski commented 5 years ago

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.

danguilherme commented 5 years ago

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?

raykin commented 5 years ago

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.

danguilherme commented 5 years ago

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.

JoshuaNitschke commented 5 years ago

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

gabynevada commented 5 years ago

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?

JoshuaNitschke commented 5 years ago

Try running npm install

On Sat, Jun 15, 2019, 11:54 Elvis Nieves notifications@github.com wrote:

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?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danguilherme/ng-cli-pug-loader/issues/19?email_source=notifications&email_token=AH6DURRL2EVG6M5ISUOVFL3P2U3F3A5CNFSM4GXJ6AC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXY6A6I#issuecomment-502390905, or mute the thread https://github.com/notifications/unsubscribe-auth/AH6DURRGLKZPR2RRPDUDWNDP2U3F3ANCNFSM4GXJ6ACQ .

gabynevada commented 5 years ago

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.

JoshuaNitschke commented 5 years ago

Is your index file html or pug?

Mine is html, everything else is pug. I'm not sure if that makes a difference. Everything is running fine on my current angular 8 project now.

If I have time I'll try to make a new project from scratch and see if I can reproduce your issue.

On Sun, Jun 16, 2019, 11:14 Elvis Nieves notifications@github.com wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danguilherme/ng-cli-pug-loader/issues/19?email_source=notifications&email_token=AH6DURSSAKIGXN2NL3EXZ5TP2Z7HDA5CNFSM4GXJ6AC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXZSJAY#issuecomment-502473859, or mute the thread https://github.com/notifications/unsubscribe-auth/AH6DURQP2DLXUMJXH4YJXNTP2Z7HDANCNFSM4GXJ6ACQ .

gabynevada commented 5 years ago

Yes, the index is html and everything else is pug.

Thanks, i'll test it on a new angular project as well, see if I get the same issue.

On Mon, Jun 17, 2019 at 3:49 AM Joshua Nitschke notifications@github.com wrote:

Is your index file html or pug?

Mine is html, everything else is pug. I'm not sure if that makes a difference. Everything is running fine on my current angular 8 project now.

If I have time I'll try to make a new project from scratch and see if I can reproduce your issue.

On Sun, Jun 16, 2019, 11:14 Elvis Nieves notifications@github.com wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/danguilherme/ng-cli-pug-loader/issues/19?email_source=notifications&email_token=AH6DURSSAKIGXN2NL3EXZ5TP2Z7HDA5CNFSM4GXJ6AC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXZSJAY#issuecomment-502473859 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AH6DURQP2DLXUMJXH4YJXNTP2Z7HDANCNFSM4GXJ6ACQ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danguilherme/ng-cli-pug-loader/issues/19?email_source=notifications&email_token=AE6464MXL4O44YTRO7XONDDP23GPRA5CNFSM4GXJ6AC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXZXVRA#issuecomment-502495940, or mute the thread https://github.com/notifications/unsubscribe-auth/AE6464KFSCIBBEGVLTOT3Z3P23GPRANCNFSM4GXJ6ACQ .

JoshuaNitschke commented 5 years ago

Did you see this? What version of node are you using? https://github.com/pugjs/pug-loader/issues/120

node -v v10.7.0

On Sun, Jun 16, 2019 at 9:19 PM Elvis Nieves notifications@github.com wrote:

Yes, the index is html and everything else is pug.

Thanks, i'll test it on a new angular project as well, see if I get the same issue.

On Mon, Jun 17, 2019 at 3:49 AM Joshua Nitschke notifications@github.com wrote:

Is your index file html or pug?

Mine is html, everything else is pug. I'm not sure if that makes a difference. Everything is running fine on my current angular 8 project now.

If I have time I'll try to make a new project from scratch and see if I can reproduce your issue.

On Sun, Jun 16, 2019, 11:14 Elvis Nieves notifications@github.com wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <

https://github.com/danguilherme/ng-cli-pug-loader/issues/19?email_source=notifications&email_token=AH6DURSSAKIGXN2NL3EXZ5TP2Z7HDA5CNFSM4GXJ6AC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXZSJAY#issuecomment-502473859

, or mute the thread <

https://github.com/notifications/unsubscribe-auth/AH6DURQP2DLXUMJXH4YJXNTP2Z7HDANCNFSM4GXJ6ACQ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/danguilherme/ng-cli-pug-loader/issues/19?email_source=notifications&email_token=AE6464MXL4O44YTRO7XONDDP23GPRA5CNFSM4GXJ6AC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXZXVRA#issuecomment-502495940 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AE6464KFSCIBBEGVLTOT3Z3P23GPRANCNFSM4GXJ6ACQ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danguilherme/ng-cli-pug-loader/issues/19?email_source=notifications&email_token=AH6DURTVYUQVOSYNA6UHWALP24GERA5CNFSM4GXJ6AC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXZ7Y3A#issuecomment-502529132, or mute the thread https://github.com/notifications/unsubscribe-auth/AH6DURU7RDVV7KS2SWEHCFDP24GERANCNFSM4GXJ6ACQ .

usman-vqode commented 5 years ago

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

gabynevada commented 5 years ago

I got node 10.16.

David-van-der-Sluijs commented 5 years ago

npm clean-install

worked for me and fixed the issue.

gabynevada commented 5 years ago

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.

perrosen commented 4 years ago

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

perrosen commented 4 years ago

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

danguilherme commented 11 months ago

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