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

After Angular 8 Update, Pug renders text only #25

Closed jasonspick closed 10 months ago

jasonspick commented 5 years ago

Now that the struggle of the Angular 8 update is over. None of my pug files are compiling. Or they are.... to plain text. Angular 8.1.0 "ng-cli-pug-loader": "^0.2.0", "pug": "^2.0.4", "pug-loader": "^2.4.0",

Did you have yo do anything different after update?

hwupu commented 5 years ago

Maybe run npm run postinstall again after update?

It will run ng-add-pug-loader.js that modify the webpack config file inside angular module.

danguilherme commented 5 years ago

Before trying the npm run postinstall solution you should delete the node_modules folder.

Try this, inside your project folder: rm -rf node_modules && npm install (postinstall will run automatically).

rHilkner commented 5 years ago

I'm having this issue also... already tried rm -rf node_modules && npm install and npm run postinstall and none worked... Is there any option besides going back to plain html? Did anyone make it run in Angular 8.2.0? I just updated angular version and my whole project crashed...

Angular 8.2.0 "ng-cli-pug-loader": "^0.2.0", "pug": "^2.0.4", "pug-loader": "^2.4.0",

jcjolley commented 4 years ago

Has anyone had any luck with this? I have it working with .pug files, but it doesn't work inside the template: `` string for a single file component

danguilherme commented 4 years ago

I didn't take a deeper look in this problem, sorry. Also not planning to do that really soon...

rHilkner commented 4 years ago

My only solution was to downgrade Angular and keep using Angular 7.

perrosen commented 4 years ago

Our setup is a bit different and might be interesting for anyone having issues. I upgraded form Angular 7 to 8 and just got it working.

  1. We pre compile index.pug before serving the project (angular.json points to a HTML file)
  2. Uninstall ng-cli-pug-loader, remove ng-add-pug-loader.js
  3. Install ng-cli-pug-loader
  4. Remove node_modules and run clean npm install
danguilherme commented 4 years ago

What do you mean by "Install ng-cli-pug-loader"? npm install ng-cli-pug-loader or ng add ng-cli-pug-loader?

undsoft commented 4 years ago

Yes, basically the problem is with the old ng-add-pug-loader.js that your project may have in the root. Removing the file and reinstalling ng-cli-pug-loader, updates the file with proper contents.

danguilherme commented 10 months ago

This project is no longer maintained. Check out ngx-pug-builders to add support to pug files to your Angular project.