{"record":{"id":"226d705c9a903e99","repo":"sveltejs/kit","slug":"page-options-are-ignored-when-router-type-ha-226d70","errorCode":null,"errorMessage":"Page options are ignored when `router.type === 'hash'` (${route.id} has ${options.filter((o) => o !== 'load').map((o) => `'${o}'`).join(', ')})","messagePattern":"Page options are ignored when `router\\.type === 'hash'` \\((.+?) has (.+?)'`\\)\\.join\\(', '\\)\\}\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/kit/src/runtime/client/client.js","lineNumber":1168,"sourceCode":"\tconst uses = {\n\t\tdependencies: new Set(),\n\t\tparams: new Set(),\n\t\tparent: false,\n\t\troute: false,\n\t\turl: false,\n\t\tsearch_params: new Set()\n\t};\n\n\tconst node = await loader();\n\n\tif (DEV) {\n\t\tvalidate_page_exports(node.universal);\n\n\t\tif (node.universal && app.hash) {\n\t\t\tconst options = Object.keys(node.universal).filter((o) => o !== 'load');\n\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'\\` (${route.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\t}\n\n\tif (__SVELTEKIT_HAS_UNIVERSAL_LOAD__ && node.universal?.load) {\n\t\t/** @param {string[]} deps */\n\t\tfunction depends(...deps) {\n\t\t\tfor (const dep of deps) {\n\t\t\t\tif (DEV) validate_depends(/** @type {string} */ (route.id), dep);\n\n\t\t\t\tconst { href } = new URL(dep, url);\n\t\t\t\tuses.dependencies.add(href);\n\t\t\t}","sourceCodeStart":1150,"sourceCodeEnd":1186,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/client/client.js#L1150-L1186","documentation":"When the router is configured with `router.type === 'hash'`, page-level options like `ssr`, `csr`, `prerender`, or `trailingSlash` exported from a route's universal (`+page.js`) file have no effect, because hash routing serves a single prerendered document. SvelteKit throws during client startup to surface the silent misconfiguration.","triggerScenarios":"Using hash routing in `svelte.config.js` while any `+page.js`/`+layout.js` (universal) exports one or more of `ssr`, `csr`, `prerender`, `trailingSlash` (anything besides `load`).","commonSituations":"Migrating an existing app to hash routing without auditing page options; copy-pasted `export const prerender = true` in a hash-routed project.","solutions":["Remove the page option exports (`ssr`, `csr`, `prerender`, `trailingSlash`) from universal files in the hash-routed app","Set the options globally in `svelte.config.js` if they are meant app-wide","Switch `router.type` back to `'pathname'` if you rely on per-route page options"],"exampleFix":"// before (+page.js, hash router)\nexport const prerender = true;\nexport const ssr = false;\nexport const load = async () => ({ ... });\n// after\nexport const load = async () => ({ ... });\n// (app-wide settings go in svelte.config.js)","handlingStrategy":"validation","validationCode":"// build/dev-time check before using hash router\nconst disallowed = ['ssr', 'csr', 'prerender', 'trailingSlash'];\nconst offending = Object.keys(pageExports).filter((k) => disallowed.includes(k));\nif (config.kit.router.type === 'hash' && offending.length) {\n  throw new Error(`Remove page options from universal files: ${offending.join(', ')}`);\n}","typeGuard":"const hasHashIncompatibleOptions = (universal) => Object.keys(universal ?? {}).some((o) => o !== 'load');","tryCatchPattern":"try {\n  startHashRouter(routes);\n} catch (e) {\n  if (e.message.includes(\"router.type === 'hash'\")) {\n    console.error('Strip ssr/csr/prerender/trailingSlash exports from +page.js/+layout.js');\n  } else throw e;\n}","preventionTips":["Audit +page.js/+layout.js files when enabling hash routing","Keep global page options in svelte.config.js rather than per-route exports","Only use per-route page options with the default pathname router"],"tags":["hash-router","page-options","config"],"backgroundTag":"page-options-ignored","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}