• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

393
Views
TypeError: angularCompiler.getNextProgram is not a function

I'm using angular 11.2 in my machine and I want to run a angular 12 project. After clone from git, I ran below commands.

  1. npm install
  2. ng serve

But I got below errors and can't run the project. I read this question but it not worked for me.

Error: ./src/main.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
TypeError: angularCompiler.getNextProgram is not a function
    at C:\Users\thimira_p\Desktop\itrd\epic-itrda-web\node_modules\@ngtools\webpack\src\ivy\plugin.js:376:100
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Error: ./src/polyfills.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
TypeError: angularCompiler.getNextProgram is not a function
    at C:\Users\thimira_p\Desktop\itrd\epic-itrda-web\node_modules\@ngtools\webpack\src\ivy\plugin.js:376:100
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Error: (webpack)-dev-server/client?http://0.0.0.0:0&sockPath=/sockjs-node
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
TypeError: angularCompiler.getNextProgram is not a function
    at C:\Users\thimira_p\Desktop\itrd\epic-itrda-web\node_modules\@ngtools\webpack\src\ivy\plugin.js:376:100
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

How to fix this issue?

over 3 years ago · Santiago Trujillo
5 answers
Answer question

0

Try to remove

"aot": true

from angular.json

over 3 years ago · Santiago Trujillo Report

0

Upgrade from @angular-devkit/build-angular@0.1100 to @angular-devkit/build-angular@12

over 3 years ago · Santiago Trujillo Report

0

I had the same problem in an Angular app which uses a custom webpack.config - having @angular-builders/custom-webpack as a dependency.

Angular and @angular-builders major versions should match.

Solved by updating @angular-builders/custom-webpack to the latest version:

npm install @angular-builders/custom-webpack@^12.0.0


If, after doing the installation, you get an error like: An unhandled exception occurred: Cannot find module 'webpack', try removing package-lock.json and node_modules and doing a clean install.


Github issue: https://github.com/just-jeb/angular-builders/issues/981

over 3 years ago · Santiago Trujillo Report

0

I'm still seen this error on @angular/core@12.0.3

The simple solution is to upgrade @angular-devkit/build-angular@0.xxx to @angular-devkit/build-angular@12.0.3.

The main point is to replace @angular-devkit/build-angular@0.xxx with @angular-devkit/build-angular@whatever_version_of_angular_you_have_installed in package.json. After that delete "node_modules" folder and do "npm install"

over 3 years ago · Santiago Trujillo Report

0

I upgraded my app to Angular 11 and had same build errors. This issue fixed for me when I downgraded below package in package.json file.

From:

"devDependencies": {
"@angular-devkit/build-angular": "~0.1102.17",
}

To:

"devDependencies": {
"@angular-devkit/build-angular": "~0.1100.2",
}

over 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error