[🐞] Navigating away while a route loader is still loading leaves `.value` as the internal NEEDS_COMPUTATION symbol; components of the old page re-render and crash
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, playwright, typescript, vite
- Área
- backend-api-design, frontend
Línea de trabajo
Start with startNavigation, abortRouteLoaderNavigation, and the async computed $setError$ and untrackedValue paths described in the issue; compare the behavior for aborted and disposed loader signals. Reproduce with the provided /g/b/ and /g/c/ routes, then run npm run verify in the linked reproduction. Done means an aborted read suspends or throws instead of returning the internal symbol, and navigating to /g/c/ completes without the old page crashing.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Which component is affected?
Qwik Runtime
Describe the bug
Version: 2.0.0-rc.3, experimental: ["catchBoundary", "pendingBoundary", "blockSSR"].
Route /g/b/ has a blockSSR: false loader that takes 1 s, read by a component inside <Pending>. Click a
link to /g/b/, then, before the loader resolves, click a link to /g/c/. The component of /g/b/ re-renders
once more and useData().value is Symbol(qwik.2.0.0-rc.3….invalid):
Data render, value: Symbol(qwik.2.0.0-rc.3-dev+3fd543f.invalid)
QWIK ERROR Cannot read properties of undefined (reading 'toLocaleString')
Every timing we tried (100, 300, 600 ms after reaching /g/b/) reproduces it. If an app has a <Catch>
around <RouterOutlet> (the v2 replacement for useErrorBoundary), the error replaces the whole app and
the navigation to /g/c/ never completes.
Minimal reproduction
Plain [email protected] empty starter with the three experimental flags in qwikVite; /g/ links to /g/b/ and /g/c/ (static). src/routes/g/b/index.tsx:
import { component$, Pending } from "@qwik.dev/core";
import { Link, routeLoader$ } from "@qwik.dev/router";
export const useData = routeLoader$(
async () => {
await new Promise((r) => setTimeout(r, 1000));
return { count: 3 };
},
{ blockSSR: false },
);
const Data = component$(() => {
const data = useData();
// After an aborted navigation `data.value` is the internal NEEDS_COMPUTATION symbol.
console.log("Data render, value:", String(data.value));
return <p id="data">{data.value.count.toLocaleString()}</p>;
});
export default component$(() => (
<main>
<h1>B</h1>
<Link id="go-c" href="/g/c/">C</Link>
<Pending fallback$={() => <p>loading…</p>}>
<Data />
</Pending>
</main>
));
Build, vite preview, open /g/, click B, then within 1 s click C.
Where
startNavigation:if (wasNavigating) abortRouteLoaderNavigation(routeLoaderCtx)callssignal.abort()
on the loaders of the navigation still in progress.- Async computed
$setError$: onAbortErrorit returns early without resetting anything, so a signal whose
first computation was aborted has no promise, no error and$untrackedValue$ === NEEDS_COMPUTATION; the
untrackedValuegetter then returns the symbol instead of throwing the promise or recomputing.
Expected
Reading .value after an abort either suspends (recomputes) or throws, but never returns the internal
symbol; and components of the page being left are not re-rendered by the abort.
Reproduction
https://github.com/Pancio-code/qwik2-rc3-repros
Steps to reproduce
git clone https://github.com/Pancio-code/qwik2-rc3-repros
cd qwik2-rc3-repros && npm install
npm run build.client && npm run build.preview
npx vite preview
Open /g/ (source: src/routes/g/). npm run verify runs the same case headless with Playwright and prints the result (see the README).
System Info
System:
OS: Linux 7.0 Ubuntu 26.04.1 LTS 26.04.1 LTS (Resolute Raccoon)
CPU: (32) x64 Intel(R) Core(TM) i9-14900HX
Container: Yes
Shell: 5.3.9 - /bin/bash
Binaries:
Node: 24.21.0 - /home/pancio_o/.nvm/versions/node/v24.21.0/bin/node
npm: 11.19.0 - /home/pancio_o/.nvm/versions/node/v24.21.0/bin/npm
Browsers:
Firefox: 158.0
Firefox Developer Edition: 158.0
Chromium (Playwright 1.64.1, used by `npm run verify`)
npmPackages:
@qwik.dev/core: 2.0.0-rc.3 => 2.0.0-rc.3
@qwik.dev/router: 2.0.0-rc.3 => 2.0.0-rc.3
typescript: 5.9.3 => 5.9.3
vite: 8.2.1 => 8.2.1
Additional Information
Found while moving a production app to 2.0.0-rc.3. With a <Catch> around <RouterOutlet> the error replaced the whole app. We carry a local patch in the ComputedSignalImpl untrackedValue getter (an aborted computation is marked invalid so the read recomputes and suspends; a disposed one suspends forever) and can open a PR if the approach is welcome. The same happens to a loader signal disposed by pruneRouteLoaders while a component of the old page renders once more. Related: #9236 (same app, different bug).
- Lenguaje dominante
- TypeScript
- Estrellas
- 22.1k
- Forks
- 1.4k
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 159
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una 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 QwikDev/qwik
-
Reveal: resolved but blocked Pending boundary hides its fallbackPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
docs router V2
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
DX enhancement V2
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
QwikDev/qwik#8480 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
preloader V2
Dificultad 4/5 1-2 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
Todos los issues de QwikDev/qwik
Issues similares
-
type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
db-ux-design-system/core-web#8856 ·
Los mantenedores suelen responder en 1 día
-
'!' breaking change is lost when the commit also has an empty BREAKING CHANGE footerPosiblemente ocupada @wittdennis la tomó hoy. Abiertopriority: p3 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
googleapis/release-please#2971 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 87/100
Los mantenedores suelen responder en 1 día
-
🛠️ dette technique
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
betagouv/mon-entreprise#4752 · 1 comentario ·
Los mantenedores suelen responder en 5 días