{"record":{"id":"b9ea6570465c0539","repo":"sveltejs/kit","slug":"the-router-resolution-option-cannot-be-server-b9ea65","errorCode":null,"errorMessage":"The `router.resolution` option cannot be 'server' if `output.bundleStrategy` is 'inline' or 'single'","messagePattern":"The `router\\.resolution` option cannot be 'server' if `output\\.bundleStrategy` is 'inline' or 'single'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/config/index.js","lineNumber":197,"sourceCode":"\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) {\n\t\tconst error = /** @type {Error} */ (e);\n\n\t\t// Print a nicer version of the error to the console\n\t\tconsole.log(styleText(['bold', 'red'], `\\n${error.message}\\n`));\n","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/config/index.js#L179-L215","documentation":"Server-side route resolution requires the client bundle to load per-route modules on demand, so it only works with `output.bundleStrategy: 'split'`. validate_config throws when `router.resolution` is 'server' but the bundle strategy is 'inline' or 'single', since those strategies produce a bundle that cannot perform server-driven resolution.","triggerScenarios":"validate_config finds `validated.kit.router.resolution === 'server'` and `validated.kit.output.bundleStrategy` is 'inline' or 'single' (anything other than 'split').","commonSituations":"Users adopt bundleStrategy 'inline'/'single' (often for simple static deployments) while router.resolution was switched to 'server' for SEO or nested-layout resolution; config defaults from an older project template clashing with newly added options.","solutions":["Set `kit.output.bundleStrategy: 'split'` in svelte.config.js.","Or set `kit.router.resolution: 'client'` to keep the inline/single bundle strategy.","If you need a single-file bundle, reconsider whether server resolution is actually required for your deployment target."],"exampleFix":"// before\nkit: { router: { resolution: 'server' }, output: { bundleStrategy: 'single' } }\n// after\nkit: { router: { resolution: 'server' }, output: { bundleStrategy: 'split' } }","handlingStrategy":"validation","validationCode":"const { router = {}, output = {} } = config.kit ?? {};\nif (router.resolution === 'server' && output.bundleStrategy !== 'split') {\n  throw new Error(\"router.resolution 'server' requires output.bundleStrategy 'split'\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  await viteBuild();\n} catch (e) {\n  if (e.message.includes(\"cannot be 'server' if `output.bundleStrategy`\")) {\n    console.error(\"Set kit.output.bundleStrategy to 'split' or use client resolution\");\n  }\n  throw e;\n}","preventionTips":["Remember server resolution requires code-split bundles","Use bundleStrategy 'inline'/'single' only with client resolution","Check bundle strategy changes against router settings in code review","Keep a validated config schema/lint rule for cross-option constraints"],"tags":["config","router","bundle","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"}