SSR manifest: `vite build --app --watch` embeds the previous round's client index.html

Aperta
#705 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
46/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, rust

Direzione di ricerca

Read the watch-mode build flow around buildStart, generateBundle, transform, and renderChunk, then trace how the server environment reads the client index.html. Reproduce with vite build --app --watch and inspect the SSR output across consecutive rounds. Done means each round embeds the matching client page and a client-only change also updates the server output.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-up to #696 (fixed in #697 for normal builds). Found while reviewing #697.

In vite build --app --watch the server environment reads the client index.html in its own buildStart. The client of the same round only writes the new page later, in generateBundle. So every round embeds the page from the round before:

round 1   embeds /src/main.ts (source page)   disk: index-CDAm_wYV.js
round 2   embeds index-CDAm_wYV.js            disk: index-DK41E1g1.js
round 3   embeds index-DK41E1g1.js            disk: index-CheYs2QK.js
→ the SSR page loads a script that is 404 and never hydrates

#697 prints a warning each round, so this is not silent, but the output is still wrong. In watch mode the two environments run at the same time, so listing client first doesn't help.

Possible fix: each client round resolves a promise in its generateBundle. The server embeds a placeholder at transform time and fills it in renderChunk / generateBundle after awaiting that promise. A client-only change also needs to rebuild (or patch) the server output.

Lingua principale
Rust
Stelle
245
Fork
26
Merge medio
1g 23m
PR unite (30g)
83

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di voidzero-dev/oxc-angular-compiler

Tutte le issue di voidzero-dev/oxc-angular-compiler

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.