Generated client entry runs before the root is parsed (async script in <head>)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 25/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript, vite
- 領域
- build-system, frontend
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
@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.
- 主要語言
- TypeScript
- 星號
- 522
- 分支
- 73
- 平均合併
- 1 天 4 小時
- 30 天內合併 PR
- 35
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
solidjs/solid-vite-plugin 的其他 Issue
-
Test environment detection doesn't consider Vitest workspaces可能已有人在做 @carloitaben 於 56 天前認領。 未關閉1.x
難度 2/5 1-3 小時 新手友好度 78/100
solidjs/solid-vite-plugin#205 · 1 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 58/100
solidjs/solid-vite-plugin#428 ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 58/100
solidjs/solid-vite-plugin#427 ·
維護者通常 1 天內回覆
-
Dev: a stylesheet shared by the entry and a lazy component moves after the lazy component's styles未關閉
難度 3/5 半天 新手友好度 62/100
solidjs/solid-vite-plugin#425 ·
維護者通常 1 天內回覆
-
[3.0.0-next.50 / next] SSR build: the $$moduleUrl export added to a Worker main module stops workerd from starting可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 3/5 半天 新手友好度 55/100
solidjs/solid-vite-plugin#420 ·
維護者通常 1 天內回覆
查看 solidjs/solid-vite-plugin 的全部 Issue
相似的 Issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難度 1/5 1 小時以內 新手友好度 90/100
lingdojo/kana-dojo#32663 · 1 則留言 · 5 個 reaction ·
維護者通常 1 天內回覆
-
Admin: Title Separator field can't be cleared (input falls back to "|")可能已有人在做 @emdashbot 今天認領。 未關閉bot:bug bot:in-review
難度 2/5 1-3 小時 新手友好度 80/100
emdash-cms/emdash#4236 · 3 則留言 ·
維護者通常 1 天內回覆
-
PHP workflow streaming requests buffer the full SSE response可能已有人在做 @Winoren 今天認領。 未關閉review: medium
難度 2/5 1-3 小時 新手友好度 84/100
langgenius/dify#44270 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
area:holodeck review-finding
難度 2/5 1-3 小時 新手友好度 62/100
hyperdrive-technology/holodeck#142 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 90/100
code-yeongyu/senpi#3573 ·
維護者通常 1 天內回覆