QwikCity static build "getStaticPaths" error in CI
When the QwikCity static adapter prerenders a dynamic route, it needs the list of parameter values to generate. Exporting onStaticGenerate (the QwikCity SSG hook) supplies them; without it, dynamic pages are skipped or the build errors.
What this error means
The static build warns that a dynamic route produced no pages, or errors that params are missing, because the route has no onStaticGenerate returning the param set.
qwik
Warning: Static route /product/[id] has no onStaticGenerate export.
No static pages generated for this dynamic segment.Common causes
A dynamic route without onStaticGenerate
The static adapter cannot know which [id] values exist, so it prerenders nothing for that route.
onStaticGenerate returns the wrong shape
Returning params in the wrong structure yields no valid pages to build.
How to fix it
Export onStaticGenerate with the params
- Add an
onStaticGenerateexport to the dynamic route returning{ params: [...] }. - Provide the full set of ids to prerender.
- Re-run the static build to confirm pages are emitted.
src/routes/product/[id]/index.tsx
export const onStaticGenerate: StaticGenerateHandler = async () => {
const ids = await getAllProductIds();
return { params: ids.map(id => ({ id })) };
};Use the static adapter only for prerenderable routes
Routes that cannot be enumerated at build time should use a server adapter instead of static SSG.
How to prevent it
- Export
onStaticGeneratefor every dynamic route you prerender. - Return
{ params: [...] }in the exact expected shape. - Use a server adapter for routes that cannot be enumerated.
Related guides
QwikCity adapter not configured for the deploy target in CIFix QwikCity deploys that fail in CI because no adapter (static, express, cloudflare-pages, vercel-edge) matc…
Qwik "qwik build" command failed in CIFix "qwik build" failures in CI - the Qwik build (client + server + optimizer) exited non-zero from a missing…
Qwik hydration/serialization mismatch during SSR in CIFix Qwik SSR serialization/hydration mismatches in CI - server-rendered state differs from what the client re…