{"record":{"id":"4f3878ae3fc6a014","repo":"sveltejs/kit","slug":"the-router-resolution-option-cannot-be-server","errorCode":null,"errorMessage":"The `router.resolution` option cannot be 'server' if `router.type` is 'hash'","messagePattern":"The `router\\.resolution` option cannot be 'server' if `router\\.type` is 'hash'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/config/index.js","lineNumber":192,"sourceCode":"\t\t\t\t'The SvelteKit options from the Vite config must be an object. See https://svelte.dev/docs/kit/configuration'\n\t\t\t);\n\t\t}\n\n\t\tconst validated = validate_options(config, 'config');\n\t\tconst files = validated.files;\n\n\t\tfiles.hooks.client ??= path.join(files.src, 'hooks.client');\n\t\tfiles.hooks.server ??= path.join(files.src, 'hooks.server');\n\t\tfiles.hooks.universal ??= path.join(files.src, 'hooks');\n\t\tfiles.params ??= path.join(files.src, 'params');\n\t\tfiles.routes ??= path.join(files.src, 'routes');\n\t\tfiles.serviceWorker ??= path.join(files.src, 'service-worker');\n\t\tfiles.appTemplate ??= path.join(files.src, 'app.html');\n\t\tfiles.errorTemplate ??= path.join(files.src, 'error.html');\n\n\t\tif (validated.router.resolution === 'server') {\n\t\t\tif (validated.router.type === 'hash') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"The `router.resolution` option cannot be 'server' if `router.type` is 'hash'\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (validated.output.bundleStrategy !== 'split') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"The `router.resolution` option cannot be 'server' if `output.bundleStrategy` is 'inline' or 'single'\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (typeof config.adapter?.vite === 'function') {\n\t\t\tvalidated.adapter.vite = config.adapter.vite({\n\t\t\t\tconfig: validated\n\t\t\t});\n\t\t}\n\n\t\treturn validated;\n\t} catch (e) {","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/config/index.js#L174-L210","documentation":"With `router.resolution: 'server'`, route resolution happens on the server so the client router needs URL-based navigation, which is impossible with `router.type: 'hash'` (hash routing never sends the route to the server). validate_config rejects this mutually incompatible combination up front.","triggerScenarios":"validate_config runs after options validation and finds `validated.kit.router.resolution === 'server'` while `validated.kit.router.type === 'hash'`.","commonSituations":"Users set hash routing for static hosts but later (or via defaults/updates) enable server-side resolution; merging partial configs where one option comes from a preset and the other is set manually.","solutions":["Change `kit.router.type` from 'hash' to 'pathname' (or 'hash' only if resolution stays client-side).","Or change `kit.router.resolution` to 'client' to keep hash routing.","Review svelte.config.js for shared/partial configs that combine these options from different sources."],"exampleFix":"// before\nkit: { router: { type: 'hash', resolution: 'server' } }\n// after\nkit: { router: { type: 'pathname', resolution: 'server' } }","handlingStrategy":"validation","validationCode":"const { router = {} } = config.kit ?? {};\nif (router.resolution === 'server' && router.type === 'hash') {\n  throw new Error(\"router.resolution 'server' is incompatible with router.type 'hash'\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  await viteBuild();\n} catch (e) {\n  if (e.message.includes(\"cannot be 'server' if `router.type` is 'hash'\")) {\n    console.error('Use pathname routing for server resolution, or client resolution for hash routing');\n  }\n  throw e;\n}","preventionTips":["Treat router.type and router.resolution as a pair when editing config","Prefer the default pathname routing unless a specific constraint requires hash","Review merged/partial configs for clashing router options","Consult the router docs before changing either option"],"tags":["config","router","incompatible-options"],"backgroundTag":"incompatible-config-combination","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}