Catch-all route chunks are named `_...404_-<hash>.js`; the `..` trips path-traversal guards and breaks the lazy preload
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript, vite
- 領域
- build-system, tooling
調査の方向性
Start by reading the client-build configuration in src/index.ts (config and configEnvironment) and src/ssr/index.ts. Reproduce with the linked solid-v2/fullstack example and inspect the production chunk name for [...404].tsx. Done means client route chunk names no longer contain path-traversal-like dot runs, while a user-supplied sanitizeFileName is preserved.
索引モデルが issue の本文から書いたものです。
説明
Summary
A catch-all route file such as [...404].tsx builds to a client chunk named _...404_-<hash>.js. Any server, static host, CDN or WAF whose path-traversal guard rejects URLs containing .. refuses that chunk. The lazy route's module preload then fails, and hydration of that route breaks:
- Without a
<Loading>boundary: the document-root fallback dies withHydration Mismatch, and the page is dead. - With one: the boundary re-imports the chunk, fails again, and the root is replaced by the entry's error UI.
Every [...rest] route is affected, deterministically, in production.
This was split out of solidjs/solid#3338, where it came up as a second, deterministic cause of the reporter's dead-page 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 fileRoutes() catch-all [...404].tsx, as a production build served by the template's server.js:
$ curl -i http://localhost:3000/assets/_...404_-BW0HgTxD.js
HTTP/1.1 404 Not Found
content-type: text/html; charset=utf-8
The template's server.js refuses any URL containing .., so the chunk request falls through to SSR and comes back as the 404 HTML page. The guard is being fixed in the template separately (resolved-path containment instead of a substring check). But substring .. checks are common in hosts and middleware the plugin doesn't control, so the chunk name itself shouldn't contain ...
For reference, the plugin's own start.node server (src/node-entry/index.ts, staticFile) only rejects path segments that start with ., so it serves this file. The failure shows up behind other guards.
Expected behavior
Client chunk file names emitted for route modules never contain .. (or other dot runs that read as path traversal). For example, [...404].tsx → _404_-<hash>.js or 404-<hash>.js. Hashing keeps the names unique.
Where it likely lives
The plugin doesn't set chunkFileNames or sanitizeFileName for the client build, so the chunk name is the bundler default ([name]-[hash].js). [name] comes from the facade module's file name. As observed above, the default naming turns [...404] into _...404_: the brackets are replaced and the dots are kept. A fix would be a client-build output.sanitizeFileName (or a chunkFileNames function) that collapses dot runs. It belongs where the plugin configures the client environment's build: the config / configEnvironment hooks in src/index.ts, and the Start client build config in src/ssr/index.ts. It should compose with a user-supplied sanitizeFileName rather than overwrite it.
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 が 44 日前に担当しました。 オープン
難易度 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 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
solidjs/solid-vite-plugin#390 ·
メンテナーはふだん 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
-
bot:ai-assisted status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
midnightntwrk/midnight-js#1424 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mksglu/context-mode#1268 ·
メンテナーはふだん 5 日以内に返信
-
[bug] Setup fails with "Cannot find matching keyid" when an older Node's corepack is on PATH対応中かも @EyalPoly が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
MystenLabs/MemWal#1124 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Edit:オープンcheck:failed streams:edit
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
iptv-org/iptv#54352 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信