lazy() moduleUrl with a leading slash never resolves: dev emits `//src/…`, the build manifest lookup misses
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript, vite
- 領域
- build-system, tooling
調査の方向性
Start with devModuleUrl in src/dev-manifest.ts and the mirrored moduleUrl() in the generated devManifestCode in src/index.ts, then inspect manifest[moduleUrl] in packages/web/src/server.ts. Run the solid-v2/fullstack reproduction in the linked issue for both dev and production builds. Done means a leading-slash moduleUrl resolves consistently in both modes, or is rejected with a clear format error.
索引モデルが issue の本文から書いたものです。
説明
Summary
A lazy() call whose hand-written moduleUrl has a leading slash ("/src/Page.tsx") never resolves. The plugin's key format is project-relative (src/Page.tsx), and nothing normalizes the slash:
- Dev: the generated URL becomes protocol-relative (
//src/Page.tsx). The preload fetcheshttp://src/Page.tsxand fails, andhydrate()falls back to a client render. - Build: the client manifest has no
/src/Page.tsxkey. The server logsAsset manifest returned no client assets for module "/src/Page.tsx"and ships no root module map. On the client, hydration throwslazy() module "/src/Page.tsx" … was not preloaded before hydration, and reactivity halts.
This was split out of solidjs/solid#3338, where it reproduced the reporter's "page looks hydrated but every signal is dead" symptom.
Reproduction
From the reproduction on solidjs/solid#3338: the solid-v2/fullstack template (solid-js / @solidjs/web 2.0.0-rc.6, @solidjs/router 2.0.0-next.21, @solidjs/vite-plugin 3.0.0-next.39), with the <Loading> removed and a route component declared as:
const Page = lazy(() => import("./Page"), undefined, "/src/Page.tsx");
- Production build: the server logs
Asset manifest returned no client assets for module "/src/Page.tsx". The client throwslazy() module "/src/Page.tsx" (hydration id "…") was not preloaded before hydrationfrom the router outlet. Reactivity halts (REACTIVITY_HALTED). - Dev: the root module map is serialized as
//src/Page.tsx. The preload requestshttp://src/Page.tsx, fails, and the fallback client render dies with an unhandledHydration Mismatch … key: undefined.
The same key without the slash ("src/Page.tsx") hydrates and stays reactive in both modes. See also the first diagnosis comment.
Expected behavior
A leading / on a moduleUrl key names the same module as the project-relative key. Either:
- it's normalized (
/src/Page.tsx→src/Page.tsx) before the dev URL is built and before the build-manifest lookup, so both modes resolve the module; or - if a leading slash is meant to be invalid, it's rejected with a clear error naming the expected project-relative format, not a silent miss.
Where it likely lives
A hand-written third argument bypasses the compiler's lazy() pass (transformLazy only rewrites one- and two-argument calls). So the user's string reaches the resolvers as-is.
- Dev:
devModuleUrlinsrc/dev-manifest.tsand its mirrormoduleUrl()in the generateddevManifestCodeinsrc/index.ts. Both buildbase + "/" + key, which gives//src/Page.tsxfor a slash-prefixed key. The comment ondevManifestCodesays to keep the two in sync. - Build: the
virtual:solid-manifestloadhook insrc/index.tsexports the raw Vite manifest (viastampClientEntry). The key lookup itself ismanifest[moduleUrl]in@solidjs/web'sresolveAssets(packages/web/src/server.tsin solidjs/solid). The production half could be fixed on either side: the plugin normalizing keys in what it exports, or the runtime normalizing before lookup. That's worth deciding before a fix, so dev and build agree.
Related but distinct: #263 (Windows separators in generated keys), #298 (dev base and root-external keys), and #299 (query strings). None of them cover a leading slash on a hand-written key.
Filed on behalf of @ryansolid. — Claude via Cursor
- 主要言語
- TypeScript
- スター
- 522
- フォーク
- 72
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid-vite-plugin のほかの issue
-
Test environment detection doesn't consider Vitest workspaces対応中かも @carloitaben が 45 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
solidjs/solid-vite-plugin#205 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
solidjs/solid-vite-plugin#394 ·
メンテナーはふだん 1 日以内に返信
-
Catch-all route chunks are named `_...404_-<hash>.js`; the `..` trips path-traversal guards and breaks the lazy preload対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
solidjs/solid-vite-plugin#391 ·
メンテナーはふだん 1 日以内に返信
-
Start mode: generated entries render without the CSP nonce, and there is no per-request seam to supply one対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
solidjs/solid-vite-plugin#388 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
solidjs/solid-vite-plugin#387 ·
メンテナーはふだん 1 日以内に返信
solidjs/solid-vite-plugin の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
wardian-app/Wardian#1603 ·
メンテナーはふだん 1 日以内に返信
-
Sign the pledgeオープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
input-output-hk/devx-updates#168 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
github/docs#46222 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
agent-ready area: config area: skills type: chore upstream: brain-kit
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
dev experience frontend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
cuttle-cards/cuttle#1403 ·
メンテナーはふだん 1 日以内に返信