Generated client entry runs before the root is parsed (async script in <head>)
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
- 25/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript, vite
- Domínio
- build-system, frontend
Direção de pesquisa
The injected script tag is generated in src/ssr/index.ts around lines 1387-1391, where the entry is placed before </head> with the async attribute. Read how the plugin chooses between async and deferred output, and check the linked repro's /, /?defer and /stream cases. Done means a fix that hydrates the slow-HTML and streamed pages without making streamed pages wait for their slowest read. Expect a design discussion about the trade-off before code.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
@solidjs/vite-plugin 3.0.0-next.49 injects the generated client entry before </head> as <script type="module" async>:
https://github.com/solidjs/solid-vite-plugin/blob/44d90fd7fb8ae6d0efc6a42c82ad2d91adc3658a/src/ssr/index.ts#L1387-L1391
An async module runs as soon as it loads. When the HTML arrives slowly, the entry can run while the browser is still parsing the body. Hydration then reaches nodes that do not exist yet and fails with Cannot read properties of null (reading 'nextSibling') (or 'firstChild'). Nothing after that point hydrates.
Repro: https://stackblitz.com/github/feledori/solid-async-entry-repro
/: a long page served at 2 kB per 50 ms. Hydration fails on every load, and the buttons near the end do nothing./?defer: the same page withasyncremoved. It hydrates every time./stream: a streamed page with a 3 s<Loading>read.DOMContentLoadedfires when the response ends (~3 s), while the async entry starts hydration at ~100 ms. So waiting forDOMContentLoaded, or droppingasync, would make every streamed page wait for its slowest read.
- Linguagem predominante
- TypeScript
- Estrelas
- 522
- Forks
- 73
- Merge médio
- 1d 4h
- PRs com merge (30d)
- 35
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de solidjs/solid-vite-plugin
-
Test environment detection doesn't consider Vitest workspacesTalvez já em andamento @carloitaben assumiu há 57 dias. Aberta1.x
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
solidjs/solid-vite-plugin#205 · 1 comentário · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 58/100
solidjs/solid-vite-plugin#428 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 58/100
solidjs/solid-vite-plugin#427 ·
Mantenedores costumam responder em até 1 dia
-
Dev: a stylesheet shared by the entry and a lazy component moves after the lazy component's stylesAberta
Dificuldade 3/5 Meio dia Facilidade para iniciantes 62/100
solidjs/solid-vite-plugin#425 ·
Mantenedores costumam responder em até 1 dia
-
[3.0.0-next.50 / next] SSR build: the $$moduleUrl export added to a Worker main module stops workerd from startingTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 3/5 Meio dia Facilidade para iniciantes 55/100
solidjs/solid-vite-plugin#420 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de solidjs/solid-vite-plugin
Issues semelhantes
-
freshness freshness:observed-only
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
thoroc/context-radar#280 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
-
documentation story
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
Billing: computeBundleEconomicsFrom treats a NULL component cost as 0, inflating bundle marginAbertabug category:billing priority:p3 track:fast
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
LanternOps/breeze#9223 ·
Mantenedores costumam responder em até 1 dia