sveltejs/kit · warning
'${id}' did not match any route (note that routes without a
Error message
'${id}' did not match any route (note that routes without a `+page` have no code to preload). It does match as a pathname — use `match(...)` from `$app/paths` to convert a pathname into a route ID What it means
The given string did not match any route ID in the app's manifest, so there is nothing to preload. SvelteKit checks whether the string matches as a URL pathname and, if so, appends guidance: route IDs are module paths like `/about/+page@svelte`, not plain pathnames — use `match()` from `$app/paths` to convert a pathname into a route ID first.
Source
Thrown at packages/kit/src/runtime/client/client.js:2896
if (!route) {
if (DEV) {
// warn rather than throw, since under client routing an endpoint-only route id is
// indistinguishable from a typo — the client manifest only contains routes with a `+page`
let message = `'${id}' did not match any route`;
if (__SVELTEKIT_CLIENT_ROUTING__) {
message += ` (note that routes without a \`+page\` have no code to preload)`;
// the most common migration mistake is passing a pathname, which used to work
const candidates = [id];
if (base && id.startsWith(base)) candidates.push(id.slice(base.length) || '/');
if (candidates.some((path) => routes.some((r) => r.exec(path)))) {
message += `. It does match as a pathname — use \`match(...)\` from \`$app/paths\` to convert a pathname into a route ID`;
}
}
console.warn(message);
}
return;
}
await load_route_nodes(route);
}
/**
* Programmatically create a new history entry with the given `page.state`. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing).
*
* @deprecated Use `goto(url, { state, shallow: true })` instead.
* @param {string | URL} url
* @param {App.PageState} state
* @returns {Promise<void>}
*/
export async function pushState(url, state) {
if (DEV && !warned_on_push_state) {View on GitHub (pinned to 03f1687fe6)
Solutions
- Convert the pathname: `const id = match('/about')?.id` from `$app/paths`, then `preloadData(id)`
- Use `resolveRoute()` or inspect `import.meta.glob`/route manifest to get the correct route ID including `+page@` suffixes
- If the string was meant as a URL to navigate, use `goto()` instead of `preloadData()`
Example fix
// before
await preloadData('/about');
// after
import { match } from '$app/paths';
const id = match('/about');
if (id) await preloadData(id); Defensive patterns
Strategy: validation
Validate before calling
import { match } from '$app/paths';
const id = match(pathname);
if (id) await preloadData(id); Type guard
function isKnownRouteId(id) { return typeof match === 'function' && match(idToPath(id)) != null; } Try / catch
const id = match(pathname);
if (!id) { console.warn('no route matches', pathname); return; }
await preloadData(id); Prevention
- Always convert pathnames to route IDs with `match()` from `$app/paths` before preloading
- Account for `+page@` layout-breakout suffixes in route IDs
- If you have a URL, prefer `goto()` over preload APIs
When it happens
Trigger: Calling `preloadData('/about')` or `preloadCode('/about')` with a raw pathname that corresponds to a page but is not a route ID, in DEV; the lookup in packages/kit/src/runtime/client/client.js fails and builds the message, appending the `match(...)` hint when pathname candidates exist.
Common situations: Confusing `goto()` URL semantics with `preloadData()` route-ID semantics; hard-coded strings like `'/blog/[slug]'` that don't match manifest IDs (e.g. need `+page@` suffixes or exact node paths).
Related errors
- '${id}' has no `+page`, so there is no code to preload. If y
- Avoid using `history.pushState(...)` and `history.replaceSta
- Cannot build with ${JSON.stringify(file)} because Bun treats
- Cannot build with ${JSON.stringify(file)} because Bun treats
- Page options are ignored when `router.type === 'hash'` (${no
AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02).
Data as JSON: /api/errors/14100a0e5f9e0456.
Report an issue: GitHub.