Why My Angular 21 Upgrade Failed

Leader ●1 ●4 ●13
calendar_today • schedule1 min read
— Originally published at dev.to

I believe Angular upgrades have become much smoother these days. Most of the time, a simple ng update is enough to move to the latest version.

Instead, I spent hours chasing errors that looked completely unrelated to the real problem

After upgrading the project to Angular 21, I started seeing errors like these:

Cannot find module '@angular/material/chips'
Cannot find module '@angular/material/dialog'

Image description

Then another one appeared:

Error: The current version of "@angular/build" supports Angular ^19...
but detected Angular version 21.x instead.

At first, it looked like Angular Material wasn't installed correctly but i think the actual issue was a version mismatch inside the project.

Some packages had already been upgraded to Angular 21:

  • @angular/core
  • @angular/common
  • @angular/material

But the build system was still using:

@angular-devkit/build-angular@19

Since Angular's build tools are tightly coupled with the framework version, the compiler started producing misleading errors.

The build pipeline was the problem.

The Commands That Helped

I used these commands:

npm ls @angular-devkit/build-angular
npm explain @angular-devkit/build-angular

They showed that my project was still resolving Angular 19's build package. That was the clue I needed and than I verified that every Angular package was using the same major version.

Then I cleaned the project completely:

rm -rf node_modules
rm package-lock.json
npm cache clean --force
npm install

It takes time usually.(and I did it several times cause Im failed )

Finally, I confirmed that all Angular packages were aligned before building again.

Want more #webdev & #angular deep dives?

Join 6,052+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

More Posts

The Senior Angular Take‑Home That Made Me Rethink Tech Interviews

Karol Modelski - Apr 2

Stop Treating Angular as a Second-Class Framework for UI Components

Karol Modelski - Apr 16

TypeScript Complexity Has Finally Reached the Point of Total Absurdity

Karol Modelski - Apr 23

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelski - Mar 19

Sovereign Intelligence: The Complete 25,000 Word Blueprint (Download)

Pocket Portfolio - Apr 1
chevron_left
1.8k Points • 18 Badges
4Posts
6Comments
6Connections
Full Stack Adventurer

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!