[2.0.1] diagnostics: a request for // crashes the dev server (Invalid URL in describeInitial)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript, vite
- Lĩnh vực
- frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.3k
- Fork
- 193
- Merge trung bình
- 8 giờ 48 phút
- Pull request đã merge (30 ngày)
- 21
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-router
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
solidjs/solid-router#757 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[2.0.1] Internal links do a full page load on a custom scheme (Electron app://)Có thể đã có người làm @saudademjj đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 20/100
solidjs/solid-router#755 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
liveQuery SSR: the producer of a `live()` server function is never finalized after the response ends (the `return()` queues behind a read-ahead `next()`)Có thể đã có người làm @clean99 đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
solidjs/solid-router#751 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[2.0.1] hashHistory: link claims and useLinkState ignore the hash, so aria-current/data-active are wrong on every linkCó thể đã có người làm @clean99 đã nhận 9 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
solidjs/solid-router#746 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
solidjs/solid-router#736 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid-router
Issue tương tự
-
area:api bug good first issue priority:high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Doezer/Questarr#1486 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:import difficulty:good-first good first issue help wanted priority:P1 roadmap size:S type:test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Sergey-Bar/Penny#245 ·
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 78/100
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 68/100
mihazs/lazysh#3377 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Approve the Cloudflare agent plugin for harness sessionsCó thể đã có người làm @joshtsch đã nhận hôm nay. Đang mởenhancement ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày