[2.0.1] diagnostics: a request for // crashes the dev server (Invalid URL in describeInitial)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- typescript, vite
- 領域
- frontend
調査の方向性
Start with describeInitial and the related URL construction call sites in src/routers/factory.tsx, then inspect the router tests for the appropriate location to add a regression case. Reproduce with a development server configured for SSR and diagnostics, or exercise the affected code through the existing test harness. The work is done when a request path beginning with // no longer throws an uncaught Invalid URL error and the server continues running.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
With @solidjs/vite-plugin's diagnostics: true, a page request whose path is // crashes the whole Vite dev server with an uncaught TypeError: Invalid URL.
The router declares the initial route for attribution through OBSERVE.attribution.withOrigin(describeInitial(...)). describeInitial resolves the location with new URL(to(), mockBase). For // that's a protocol-relative URL with an empty host, so the constructor throws. The getter is read in settleRender, outside any try/catch, so the dev process exits.
The same request answers 200 with diagnostics: false, and in the production build (node dist/server/node.js).
Versions: @solidjs/router 2.0.1 (the code is unchanged on main), solid-js 2.0.4, @solidjs/web 2.0.4, @solidjs/vite-plugin 3.0.1, vite 8.4.0.
Steps to Reproduce the Bug or Issue
- Start mode with
ssr: trueanddiagnostics: true, Solid Router 2 mounted inApp;pnpm dev curl 'http://localhost:3000//'- The dev server exits:
TypeError: Invalid URL
at new URL (node:internal/url:819:25)
at pathname (@solidjs/router/dist/routers/factory.jsx:104:28)
at Object.<Routes routerState={routerState} branches={branches}/> (@solidjs/router/dist/routers/factory.jsx:112:37)
at Object.settle (@solidjs/web/dist/server.dev.js:357:19)
...
code: 'ERR_INVALID_URL',
input: '//',
base: 'http://sr'
Expected behavior
The request renders (or 404s) and the dev server keeps running.
Platform
- OS: Linux
- Browser: any (also plain
curl) - Node: 24.14.1
Additional context
Other new URL(…, mockBase) calls in factory.tsx may have the same problem for paths starting with //, e.g. the navigation attribution's pathname.
Workaround: a start middleware that redirects paths with repeated slashes to their single-slash form.
- 主要言語
- TypeScript
- スター
- 1.3k
- フォーク
- 193
- 平均マージ
- 8時間 48分
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid-router のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
solidjs/solid-router#757 ·
メンテナーはふだん 1 日以内に返信
-
[2.0.1] Internal links do a full page load on a custom scheme (Electron app://)対応中かも @saudademjj が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
solidjs/solid-router#755 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
liveQuery SSR: the producer of a `live()` server function is never finalized after the response ends (the `return()` queues behind a read-ahead `next()`)対応中かも @clean99 が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
solidjs/solid-router#751 ·
メンテナーはふだん 1 日以内に返信
-
[2.0.1] hashHistory: link claims and useLinkState ignore the hash, so aria-current/data-active are wrong on every link対応中かも @clean99 が 9 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
solidjs/solid-router#746 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
solidjs/solid-router#736 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
solidjs/solid-router の issue をすべて見る
似ている issue
-
area:api bug good first issue priority:high
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Doezer/Questarr#1486 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:import difficulty:good-first good first issue help wanted priority:P1 roadmap size:S type:test
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Sergey-Bar/Penny#245 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mihazs/lazysh#3377 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Approve the Cloudflare agent plugin for harness sessions対応中かも @joshtsch が今日担当しました。 オープンenhancement ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信