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

Aberta
#705 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
46/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
javascript, rust

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Rust
Estrelas
245
Forks
26
Merge médio
1d 23min
PRs com merge (30d)
83

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de voidzero-dev/oxc-angular-compiler

Todas as issues de voidzero-dev/oxc-angular-compiler

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.