[2.0.1] diagnostics: a request for // crashes the dev server (Invalid URL in describeInitial)
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- typescript, vite
- Domínio
- frontend
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 1.3k
- Forks
- 193
- Merge médio
- 8h 48min
- PRs com merge (30d)
- 21
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de solidjs/solid-router
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
solidjs/solid-router#757 ·
Mantenedores costumam responder em até 1 dia
-
[2.0.1] Internal links do a full page load on a custom scheme (Electron app://)Talvez já em andamento @saudademjj assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 20/100
solidjs/solid-router#755 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
liveQuery SSR: the producer of a `live()` server function is never finalized after the response ends (the `return()` queues behind a read-ahead `next()`)Talvez já em andamento @clean99 assumiu há 2 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
solidjs/solid-router#751 ·
Mantenedores costumam responder em até 1 dia
-
[2.0.1] hashHistory: link claims and useLinkState ignore the hash, so aria-current/data-active are wrong on every linkTalvez já em andamento @clean99 assumiu há 10 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
solidjs/solid-router#746 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
solidjs/solid-router#736 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de solidjs/solid-router
Issues semelhantes
-
Blocklist addition requestAbertablocklist addition
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 76/100
MetaMask/eth-phishing-detect#319194 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
continuedev/continue#13533 · 1 comentário ·
Mantenedores costumam responder em até 6 dias
-
bug codex:automation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
genfeedai/genfeed.ai#12060 ·
Mantenedores costumam responder em até 1 dia
-
bounty good first issue help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
fitzss/valun-open#15 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia