sveltejs/kit · error · Error
Page options are ignored when `router.type === 'hash'` (${no
Error message
Page options are ignored when `router.type === 'hash'` (${node.universal_id} has ${options}) What it means
When `router.type` is 'hash', page/route-level export options other than `load` (e.g. `ssr`, `csr`, `prerender`, `trailingSlash` in +page.js) have no effect because there are no server requests, so SvelteKit fails the build instead of silently ignoring them. The error names the universal (+page.js) node id and the offending option keys.
Source
Thrown at packages/kit/src/core/postbuild/analyse.js:75
/** @type {typeof import('<sveltekit:generated>/env/config.js')} */
const { set_env } = await import(pathToFileURL(`${server_root}/server/env.js`).href);
set_env(env);
/** @type {import('types').ServerMetadata} */
const metadata = {
nodes: [],
routes: new Map(),
remotes: new Map()
};
const nodes = await Promise.all(manifest.nodes.map((loader) => loader()));
// analyse nodes
for (const node of nodes) {
if (hash && node.universal) {
const options = Object.keys(node.universal).filter((o) => o !== 'load');
if (options.length > 0) {
throw new Error(
`Page options are ignored when \`router.type === 'hash'\` (${node.universal_id} has ${options
.filter((o) => o !== 'load')
.map((o) => `'${o}'`)
.join(', ')})`
);
}
}
metadata.nodes[node.index] = {
has_server_load: has_server_load(node),
has_universal_load: node.universal?.load !== undefined
};
}
// analyse routes
for (const route of manifest.routes) {
const page =
route.page &&View on GitHub (pinned to 03f1687fe6)
Solutions
- Remove the non-load page option exports from the +page.js file named in the error.
- Alternatively, switch `router.type` back to 'pathname' if you need per-page options.
- Move any needed behavior (like disabling SSR) into global kit config, which hash routing respects.
Example fix
// before (+page.js)
export const prerender = true;
export const load = () => ({});
// after (+page.js)
export const load = () => ({}); Defensive patterns
Strategy: validation
Validate before calling
// with router.type === 'hash', flag non-load page exports in +page.js files
if (config.kit?.router?.type === 'hash') {
const src = await fs.readFile('src/routes/+page.js', 'utf8');
const opts = [...src.matchAll(/export\s+const\s+(\w+)/g)]
.map((m) => m[1]).filter((o) => o !== 'load');
if (opts.length) throw new Error(`Page options ignored under hash routing: ${opts}`);
} Try / catch
try {
await build();
} catch (e) {
if (String(e.message).includes("router.type === 'hash'")) {
console.error('Remove page option exports or switch back to pathname routing:', e.message);
} else throw e;
} Prevention
- After switching router.type to 'hash', grep +page.js files for `export const` other than `load`.
- Configure routing behavior globally in kit config when using hash routing.
- Document in the team wiki that hash routes support no per-page options.
When it happens
Trigger: A project using `kit.router.type = 'hash'` has any +page.js that exports `ssr`, `csr`, `prerender`, `trailingSlash`, `config`, or similar non-load page options.
Common situations: Migrating an app from pathname routing to hash routing while keeping existing page options; library components shipping +page.js examples with options set.
Related errors
- Cannot prerender a route with both +page and +server files (
- Mismatched route config for ${route.id} — the +page and +ser
- Cannot prerender a +server file with ${BODY_DEPENDENT_METHOD
- To suppress or handle this error, implement `${name}` in htt
- Could not create a fallback page
AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02).
Data as JSON: /api/errors/fda929d58d05c91a.
Report an issue: GitHub.