Angular project in subfolder of Git worktree emits cache at root of main Git repo
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- angular, git, typescript
- Ambito
- build-system, cli
Direzione di ricerca
Start by reproducing the cache discrepancy with the supplied Git worktree layout, using ng cache info and npm run build from both the worktree and main repository. Trace how the Angular CLI chooses the cache path for projects nested under Site#/ClientApp. Done means worktree builds do not create an unexpected root .angular/cache and related projects use appropriately separated, consistent cache locations.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Command
build
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
22.0.x
Description
With #33321, the Angular CLI now shares build caches between Git worktrees. However, I'm not sure that it's working as expected with Angular projects that live in folders deeper than the root of the repo.
My repo is a C# solution with 3 web apps using Angular, which looks something like this:
- Solution/
- Site1/
- ClientApp/ (Angular project root)
- Site2/
- ClientApp/ (Angular project root)
- Site3/
- ClientApp/ (Angular project root)
- Site1/
After upgrading to Angular 22.1+, if I am on a Git worktree and build any of the Angular apps, the main repo gets new cache files at: `/.angular/cache//ClientApp/
Building the Angular projects in the main repo does not use the same cache. Those continue to use the caches at <repo root>/Site#/ClientApp/.angular/. Running ng cache info on an app in the main repo vs a worktree shows this discrepancy:
# From main repo folder
> npx ng cache info
Path : C:\Path\To\Solution\Site1\ClientApp\.angular\cache
# From worktree folder
> npx ng cache info
Path : C:\Path\To\Solution\.angular\cache
This feels unexpected for a few reasons:
- All three unrelated sites are using the same cache, since they are all called ClientApp (due to ASP.NET convention)
- The cache lives at the root of the main repo, even though there is no Angular project there
- The main repo doesn't use the same cache location as the worktrees
Minimal Reproduction
mkdir Solution
git init
ng new --skip-git
# use TestApp as app name for example
git add .
git commit -m "Initial commit"
git worktree add --detach ../Solution-worktree main
cd ../Solution-worktree/TestApp
npm i
npm run build
cd ../../Solution
git status
# Would expect no changes, but new untracked .angular folder with caches is present
Exception or Error
Your Environment
Angular CLI : 22.2.0
Angular : 22.2.0
Node.js : 24.19.0
Package Manager : npm 11.17.0
Operating System : win32 x64
┌───────────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────────┼───────────────────┼───────────────────┤
│ @angular-devkit/architect │ 0.2202.0 │ ^0.2202.0 │
│ @angular-devkit/build-angular │ 22.2.0 │ ^22.2.0 │
│ @angular-devkit/core │ 22.2.0 │ ^22.2.0 │
│ @angular/aria │ 22.2.0 │ ^22.2.0 │
│ @angular/build │ 22.2.0 │ ^22.2.0 │
│ @angular/cdk │ 22.2.0 │ ^22.2.0 │
│ @angular/cli │ 22.2.0 │ ^22.2.0 │
│ @angular/common │ 22.2.0 │ ^22.2.0 │
│ @angular/compiler │ 22.2.0 │ ^22.2.0 │
│ @angular/compiler-cli │ 22.2.0 │ ^22.2.0 │
│ @angular/core │ 22.2.0 │ ^22.2.0 │
│ @angular/forms │ 22.2.0 │ ^22.2.0 │
│ @angular/material │ 22.2.0 │ ^22.2.0 │
│ @angular/platform-browser │ 22.2.0 │ ^22.2.0 │
│ @angular/router │ 22.2.0 │ ^22.2.0 │
│ @angular/upgrade │ 22.2.0 │ ^22.2.0 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 6.0.3 │ ~6.0.3 │
│ vitest │ 4.1.10 │ ^4.1.10 │
│ zone.js │ 0.15.1 │ ~0.15.0 │
Anything else relevant?
No response
- Lingua principale
- TypeScript
- Stelle
- 27k
- Fork
- 11.8k
- Merge medio
- 22h 44m
- PR unite (30g)
- 177
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di angular/angular-cli
-
area: @angular/build gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
angular/angular-cli#33955 ·
I maintainer di solito rispondono entro 1 giorno
-
area: @angular/cli gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
angular/angular-cli#33055 · 1 commento · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
area: @angular/build
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
angular/angular-cli#34231 ·
I maintainer di solito rispondono entro 1 giorno
-
stats.json is non-deterministic when two component stylesheets produce the same output fileForse già presa @sdjayna l’ha presa 1 giorno fa. Apertaarea: @angular/build gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
angular/angular-cli#34209 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
angular/angular-cli#34207 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di angular/angular-cli
Issue simili
-
area/core status/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
google-gemini/gemini-cli#29602 ·
I maintainer di solito rispondono entro 1 giorno
-
area: backend enhancement priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
snapotter-hq/SnapOtter#1879 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
Tencent/BrowserSkill#390 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue status: needs triaging type: bug version: 2.0
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
medusajs/medusa#17094 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno