{"record":{"id":"76df442d12f61b43","repo":"sveltejs/kit","slug":"cannot-use-split-true-alongside-edge-true","errorCode":null,"errorMessage":"Cannot use `split: true` alongside `edge: true`","messagePattern":"Cannot use `split: true` alongside `edge: true`","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-netlify/index.js","lineNumber":98,"sourceCode":"\n\t\t\tbuilder.log.minor(`Publishing to \"${publish}\"`);\n\n\t\t\tbuilder.log.minor('Copying assets...');\n\t\t\tconst publish_dir = `${publish}${builder.config.paths.base}`;\n\t\t\tbuilder.writeClient(publish_dir);\n\t\t\tbuilder.writePrerendered(publish_dir);\n\n\t\t\t// Copy user's custom _headers file if it exists\n\t\t\tif (existsSync('_headers')) {\n\t\t\t\tbuilder.copy('_headers', join(publish, '_headers'));\n\t\t\t}\n\n\t\t\tbuilder.log.minor('Writing Netlify config...');\n\t\t\twrite_frameworks_config({ builder });\n\n\t\t\tif (edge) {\n\t\t\t\tif (split) {\n\t\t\t\t\tthrow new Error('Cannot use `split: true` alongside `edge: true`');\n\t\t\t\t}\n\n\t\t\t\tawait generate_edge_functions({ builder });\n\t\t\t} else {\n\t\t\t\tgenerate_serverless_functions({ builder, split, publish });\n\t\t\t}\n\t\t},\n\n\t\tsupports: {\n\t\t\tread: () => true,\n\t\t\tinstrumentation: () => true\n\t\t}\n\t};\n}\n\n/**\n * @param { object } params\n * @param {import('@sveltejs/kit').Builder} params.builder","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/adapter-netlify/index.js#L80-L116","documentation":"adapter-netlify's split option generates one serverless function per route, while edge functions use a single edge deployment; the two strategies are mutually exclusive. The adapter throws this at adapt() time when both edge and split resolve to true.","triggerScenarios":"Configuring adapter-netlify with both `split: true` and `edge: true` (explicitly in svelte.config.js, or edge enabled via the NETLIFY_EDGE env var while split is true in the config).","commonSituations":"Enabling edge functions by setting an environment variable while forgetting split: true left over from an earlier config; merging team config changes that each set one flag.","solutions":["Remove `split: true` from the adapter options if you want edge functions","Set edge: false (and unset any NETLIFY_EDGE env var) if you want split serverless functions","Pick one strategy: split only applies to serverless function generation"],"exampleFix":"// before\nadapter({ split: true, edge: true })\n// after\nadapter({ split: false, edge: true })","handlingStrategy":"validation","validationCode":"const { split = false, edge = false } = adapterOptions;\nif (split && edge) throw new Error('split and edge are mutually exclusive');","typeGuard":null,"tryCatchPattern":"try {\n  await vite.build();\n} catch (e) {\n  if (e.message.includes('split: true` alongside `edge')) {\n    console.error('Disable either split or edge in adapter-netlify options');\n  }\n  throw e;\n}","preventionTips":["Only enable one of split/edge in svelte.config.js","Check NETLIFY_EDGE environment variables when builds run on Netlify with split enabled","Review config diffs so one flag isn't left set when the other is added"],"tags":["config","netlify","mutually-exclusive-options"],"backgroundTag":"conflicting-config-options","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}