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

Problems with Angular 10 #36

Closed diogoterremoto closed 4 years ago

diogoterremoto commented 4 years ago

First of all, thanks @danguilherme for making this. I really enjoy using pug, so this is essencial.

After upgrading an app from Angular 9 to 10, I got this error when building the app:

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| ng-container
>       header-block

Any workarounds?

diogoterremoto commented 4 years ago

Alrighty, figured out what's happening.

We know ng-add-pug-loader.js script is editing files inside the @angular-devkit module. I was using the @angular-builders/custom-webpack as the app production builder instead of the default one, that has @angular-devkit as a dependency with a previous version, different from the one that Angular 10 uses. This will make the package @angular-builders/custom-webpack to install and use that previous version.

As such, the solution was to specify @angular-builders/custom-webpack to use at least the 10.0.0-beta.0 version in package.json.