[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 分钟
- 30 天内合并 PR
- 21
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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
维护者通常 1 天内回复
-
Approve the Cloudflare agent plugin for harness sessions可能已有人在做 @joshtsch 今天认领。 未关闭enhancement ready-for-agent
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复