{"record":{"id":"fda929d58d05c91a","repo":"sveltejs/kit","slug":"page-options-are-ignored-when-router-type-ha","errorCode":null,"errorMessage":"Page options are ignored when `router.type === 'hash'` (${node.universal_id} has ${options})","messagePattern":"Page options are ignored when `router\\.type === 'hash'` \\((.+?) has (.+?)\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/postbuild/analyse.js","lineNumber":75,"sourceCode":"\t/** @type {typeof import('<sveltekit:generated>/env/config.js')} */\n\tconst { set_env } = await import(pathToFileURL(`${server_root}/server/env.js`).href);\n\tset_env(env);\n\n\t/** @type {import('types').ServerMetadata} */\n\tconst metadata = {\n\t\tnodes: [],\n\t\troutes: new Map(),\n\t\tremotes: new Map()\n\t};\n\n\tconst nodes = await Promise.all(manifest.nodes.map((loader) => loader()));\n\n\t// analyse nodes\n\tfor (const node of nodes) {\n\t\tif (hash && node.universal) {\n\t\t\tconst options = Object.keys(node.universal).filter((o) => o !== 'load');\n\t\t\tif (options.length > 0) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Page options are ignored when \\`router.type === 'hash'\\` (${node.universal_id} has ${options\n\t\t\t\t\t\t.filter((o) => o !== 'load')\n\t\t\t\t\t\t.map((o) => `'${o}'`)\n\t\t\t\t\t\t.join(', ')})`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tmetadata.nodes[node.index] = {\n\t\t\thas_server_load: has_server_load(node),\n\t\t\thas_universal_load: node.universal?.load !== undefined\n\t\t};\n\t}\n\n\t// analyse routes\n\tfor (const route of manifest.routes) {\n\t\tconst page =\n\t\t\troute.page &&","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/postbuild/analyse.js#L57-L93","documentation":"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.","triggerScenarios":"A project using `kit.router.type = 'hash'` has any +page.js that exports `ssr`, `csr`, `prerender`, `trailingSlash`, `config`, or similar non-load page options.","commonSituations":"Migrating an app from pathname routing to hash routing while keeping existing page options; library components shipping +page.js examples with options set.","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."],"exampleFix":"// before (+page.js)\nexport const prerender = true;\nexport const load = () => ({});\n// after (+page.js)\nexport const load = () => ({});","handlingStrategy":"validation","validationCode":"// with router.type === 'hash', flag non-load page exports in +page.js files\nif (config.kit?.router?.type === 'hash') {\n  const src = await fs.readFile('src/routes/+page.js', 'utf8');\n  const opts = [...src.matchAll(/export\\s+const\\s+(\\w+)/g)]\n    .map((m) => m[1]).filter((o) => o !== 'load');\n  if (opts.length) throw new Error(`Page options ignored under hash routing: ${opts}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await build();\n} catch (e) {\n  if (String(e.message).includes(\"router.type === 'hash'\")) {\n    console.error('Remove page option exports or switch back to pathname routing:', e.message);\n  } else throw e;\n}","preventionTips":["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."],"tags":["build","routing","prerender"],"backgroundTag":"page-option-ignored-hash-router","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}