Generated client entry runs before the root is parsed (async script in <head>)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript, vite
- Lĩnh vực
- build-system, frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
@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.
- Ngôn ngữ chính
- TypeScript
- Star
- 522
- Fork
- 73
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của solidjs/solid-vite-plugin
-
Test environment detection doesn't consider Vitest workspacesCó thể đã có người làm @carloitaben đã nhận 57 ngày trước. Đang mở1.x
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
solidjs/solid-vite-plugin#205 · 1 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
solidjs/solid-vite-plugin#428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
solidjs/solid-vite-plugin#427 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dev: a stylesheet shared by the entry and a lazy component moves after the lazy component's stylesĐang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 62/100
solidjs/solid-vite-plugin#425 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[3.0.0-next.50 / next] SSR build: the $$moduleUrl export added to a Worker main module stops workerd from startingCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
solidjs/solid-vite-plugin#420 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid-vite-plugin
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Pet submission: Sleepwing / 眠翼鸟Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
OpenPetsHQ/openpets#273 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
fritzprix/libr-agent#2161 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS: clicking a menu item that has a submenu closes the menu instead of opening the submenuĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
blackboardsh/electrobun#581 ·
-
backlog-skill effort:xs frontend infra ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
LucasSantana-Dev/Lucky#2862 ·
Maintainer thường phản hồi trong vòng 1 ngày