0

I've just update my angular 11 project to 12.
I'm using @angular-builders/custom-webpack package in my devDependencies and using the following command to build my angular project.

ng build --configuration=production --build-optimizer --optimization

but after updating to angular 12, I'm getting the following error:

Error: ./src/main.ts
Module build failed (from ./node_modules/@angular-builders/custom-webpack/node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack/src/ivy/index.js):
TypeError: angularCompiler.getNextProgram is not a function
    at D:\Sources\******\Apps\******-Angular\node_modules\@angular-builders\custom-webpack\node_modules\@angular-devkit\build-angular\node_modules\@ngtools\webpack\src\ivy\plugin.js:390:61
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
 @ multi ./src/main.ts main[0]

I'm using the following package:

"@angular-builders/custom-webpack": "^11.1.1"
Mohammad Dayyan
  • 21,578
  • 41
  • 164
  • 232
  • https://github.com/angular/angular-cli/issues/20778#issuecomment-841151098 – yurzui May 15 '21 at 03:19
  • https://github.com/just-jeb/angular-builders/issues/981 – Mohammad Dayyan May 15 '21 at 04:26
  • Your issue should be solved by taken the actions outlined in issue [#20786](https://github.com/angular/angular-cli/issues/20786). Make sure `@angular-devkit/build-angular` is the correct version. In my case I removed `webpack` from the devDependencies, and I installed `webpack-cli` instead. See the post for a full discussion. – Winthorpe May 15 '21 at 23:22

1 Answers1

0

The problem was gone with installing version 12 of @angular-builders/custom-webpack
nowadays 12.0.0-beta.0

@angular-builders/custom-webpack@12.0.0-beta.0
Mohammad Dayyan
  • 21,578
  • 41
  • 164
  • 232