Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Changes will no longer be recognized if you remove and re-add same component

Open
#28,956 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
angular, typescript

Research direction

Start with the linked StackBlitz reproductions and run the serve command using the remove-and-re-add sequence described in the issue. Compare behavior before and after ng cache clean; done means subsequent changes to the re-added component are recognized without clearing the Angular cache or restarting the dev server.

Written by the indexing model from the issue text.

Description

angular/build:application area: @angular/build freq1: low severity5: regression type: bug/fix
Command

serve

Is this a regression?
  • Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was

No response

Description

Changes will no longer be recognized if you remove and re-add same component.

Minimal Reproduction

Removing and re-adding the import of the component (import { TestComponent } from ‘./test/test.component’), the component in the imports array and in the template (<app-test>) leads to that no further changes to this component are recognized.

Image

Repro App V18

Problem also in V19

Exception or Error

Your Environment
**v18 Reproduction environment:**
Angular CLI: 18.2.12
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 18.2.12
... animations, build, cli, common, compiler, compiler-cli, core
... forms, platform-browser, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1802.12
@angular-devkit/core         18.2.12 (cli-only)
@angular-devkit/schematics   18.2.12
@schematics/angular          18.2.12
rxjs                         7.8.1
typescript                   5.5.4
zone.js                      0.14.10

**v19 Reproduction environment:**
Angular CLI: 19.0.0
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 19.0.0
... animations, build, cli, common, compiler, compiler-cli, core
... forms, platform-browser, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1900.0
@angular-devkit/core         19.0.0
@angular-devkit/schematics   19.0.0
@schematics/angular          19.0.0
rxjs                         7.8.1
typescript                   5.6.3
zone.js                      0.15.0
Anything else relevant?

After clearing the Angular cache with ng cache clean and restarting the dev server with ng serve it works again.
So probably a caching bug.

Dominant language
TypeScript
Stars
27k
Forks
11.8k
Avg merge
16h 35m
Merged PRs (30d)
176

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from angular/angular-cli

All issues in angular/angular-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.