Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Running two ng serve instances (same project, different configurations) causes “504 Outdated Optimize Dep” errors in Angular CLI 20.3.8

Offen
#31,700 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
angular, typescript, vite
Bereich
cli

Rechercherichtung

Beginnen Sie mit der Reproduktion über package.json start:both und untersuchen Sie das gemeinsame .angular/cache/.../vite-Optimizerverzeichnis, während beide ng serve-Prozesse laufen. Die Behebung ist abgeschlossen, wenn parallele Server für unterschiedliche Konfigurationen erfolgreich laden, ohne 504 Outdated Optimize Dep-Fehler.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area: @angular/build devkit/build-angular:dev-server 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

20.3.6

Description

Since updating to Angular v20.3.9 / CLI v20.3.8, it’s no longer possible to run two ng serve instances for the same project (e.g. localized builds) in parallel.
The second instance fails to load with a 504 (Outdated Optimize Dep) error for one or more chunks (e.g. chunk-5V7QYGNA.js).

This setup worked correctly in previous Angular 20.3.6 versions (before the CLI migrated the dev-server to the Vite-based implementation).

The issue appears to be caused by both ng serve processes sharing the same Vite optimizer cache directory inside .angular/cache/.../vite.
When one process updates or invalidates the cache, the other process detects stale metadata and refuses to serve pre-bundled chunks.

Minimal Reproduction

package.json scripts
"scripts": {
"start": "ng serve --host 0.0.0.0",
"startfr": "ng serve -c fr --host 0.0.0.0",
"startfr-alt": "ng serve -c fr --host 0.0.0.0 --port 4201",
"start:both": "concurrently "npm run start" "npm run startfr-alt""
}

Steps to reproduce
1. Run npm run start:both.
2. Wait for both dev servers to start.
3. Observe that the second instance fails to load in the browser console with:
Failed to load resource: the server responded with a status of 504 (Outdated Optimize Dep)

Exception or Error
Failed to load resource: the server responded with a status of 504 (Outdated Optimize Dep)
Your Environment
Angular CLI: 20.3.8
Node: 24.1.0
Package Manager: yarn 4.9.2
OS: darwin arm64
    

Angular: 20.3.9
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------
@angular-devkit/architect       0.2003.8
@angular-devkit/build-angular   20.3.8
@angular-devkit/core            20.3.8
@angular-devkit/schematics      20.3.8
@angular/cdk                    20.2.11
@angular/cli                    20.3.8
@angular/material               20.2.11
@schematics/angular             20.3.8
rxjs                            7.8.2
typescript                      5.8.3
zone.js                         0.15.1
Anything else relevant?

No response

Vorherrschende Sprache
TypeScript
Sterne
27k
Forks
11.8k
Ø Merge
17 Std. 25 Min.
Gemergte PRs (30 T.)
183

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus angular/angular-cli

Alle Issues in angular/angular-cli

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.