Generated client entry runs before the root is parsed (async script in <head>)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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時間
- マージ済み PR(30日)
- 35
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid-vite-plugin のほかの issue
-
Test environment detection doesn't consider Vitest workspaces対応中かも @carloitaben が 57 日前に担当しました。 オープン1.x
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
solidjs/solid-vite-plugin#205 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 半日 初心者へのやさしさ 55/100
solidjs/solid-vite-plugin#420 ·
メンテナーはふだん 1 日以内に返信
solidjs/solid-vite-plugin の issue をすべて見る
似ている issue
-
bug priority: P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
wayfinder:task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug customer-reported data-plane question Service Attention Storage
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
Azure/azure-rest-api-specs#47397 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Claude thinking budget can shrink capped Haiku responses to 2,048 tokens対応中かも @DavyMassoneto が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
diegosouzapw/OmniRoute#17109 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
paperclipai/paperclip#16785 ·
メンテナーはふだん 1 日以内に返信