Skip to content
Latchkey

SvelteKit "Not found: /path" during prerendering in CI

During prerendering, SvelteKit crawls links from each page. If a link points at a route that returns 404, the build fails by default and reports which page linked to the missing path.

What this error means

svelte-kit build fails with "404 /missing (linked from /home)" or "Not found: /missing" during the prerender pass. The dev server tolerated the broken link.

sveltekit
> 404 /blog/old-post (linked from /blog)
Error: Not found: /blog/old-post
    at file:///app/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js

Common causes

A link points to a route that does not exist

A hardcoded or stale href references a path with no matching route, so the crawler hits a 404.

A dynamic page is not in the prerender entries

A dynamic route is linked but not enumerated, so the crawler cannot find a prerendered file for it.

How to fix it

Fix or remove the broken link

  1. Read the "linked from" page in the error to find the bad href.
  2. Point it at a real route or remove the dead link.
  3. Re-run the build so the crawler passes.
src/routes/blog/+page.svelte
<!-- correct the href to an existing route -->
<a href="/blog/current-post">Read more</a>

Handle missing pages without failing the build

If some links are intentionally external or optional, configure prerender to warn instead of error, or add explicit entries.

svelte.config.js
// svelte.config.js
kit: { prerender: { handleHttpError: 'warn' } }

How to prevent it

  • Keep internal links pointing at real routes.
  • Add dynamic routes to prerender entries when they are linked.
  • Use handleHttpError: 'warn' only for genuinely optional links.

Frequently asked questions

What causes ""Not found: /path""?
A hardcoded or stale href references a path with no matching route, so the crawler hits a 404.
How do I fix "Not found: /path"?
Fix or remove the broken link

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card