[2.0.1] diagnostics: a request for // crashes the dev server (Invalid URL in describeInitial)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript, vite
- Área
- frontend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.3k
- Forks
- 193
- Merge medio
- 8 h 48 min
- PR fusionados (30 d)
- 21
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de solidjs/solid-router
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
solidjs/solid-router#757 ·
Los mantenedores suelen responder en 1 día
-
[2.0.1] Internal links do a full page load on a custom scheme (Electron app://)Posiblemente ocupada @saudademjj la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 20/100
solidjs/solid-router#755 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
liveQuery SSR: the producer of a `live()` server function is never finalized after the response ends (the `return()` queues behind a read-ahead `next()`)Posiblemente ocupada @clean99 la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
solidjs/solid-router#751 ·
Los mantenedores suelen responder en 1 día
-
[2.0.1] hashHistory: link claims and useLinkState ignore the hash, so aria-current/data-active are wrong on every linkPosiblemente ocupada @clean99 la tomó hace 9 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
solidjs/solid-router#746 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
solidjs/solid-router#736 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de solidjs/solid-router
Issues similares
-
area:api bug good first issue priority:high
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Doezer/Questarr#1486 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area:import difficulty:good-first good first issue help wanted priority:P1 roadmap size:S type:test
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Sergey-Bar/Penny#245 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
mihazs/lazysh#3377 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Approve the Cloudflare agent plugin for harness sessionsPosiblemente ocupada @joshtsch la tomó hoy. Abiertoenhancement ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día