sveltejs/kit · error · Error
Cannot use `split: true` alongside `edge: true`
Error message
Cannot use `split: true` alongside `edge: true`
What it means
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.
Source
Thrown at packages/adapter-netlify/index.js:98
builder.log.minor(`Publishing to "${publish}"`);
builder.log.minor('Copying assets...');
const publish_dir = `${publish}${builder.config.paths.base}`;
builder.writeClient(publish_dir);
builder.writePrerendered(publish_dir);
// Copy user's custom _headers file if it exists
if (existsSync('_headers')) {
builder.copy('_headers', join(publish, '_headers'));
}
builder.log.minor('Writing Netlify config...');
write_frameworks_config({ builder });
if (edge) {
if (split) {
throw new Error('Cannot use `split: true` alongside `edge: true`');
}
await generate_edge_functions({ builder });
} else {
generate_serverless_functions({ builder, split, publish });
}
},
supports: {
read: () => true,
instrumentation: () => true
}
};
}
/**
* @param { object } params
* @param {import('@sveltejs/kit').Builder} params.builderView on GitHub (pinned to 03f1687fe6)
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
Example fix
// before
adapter({ split: true, edge: true })
// after
adapter({ split: false, edge: true }) Defensive patterns
Strategy: validation
Validate before calling
const { split = false, edge = false } = adapterOptions;
if (split && edge) throw new Error('split and edge are mutually exclusive'); Try / catch
try {
await vite.build();
} catch (e) {
if (e.message.includes('split: true` alongside `edge')) {
console.error('Disable either split or edge in adapter-netlify options');
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- The _headers file should be placed in the project root rathe
- The _redirects file should be placed in the project root rat
- Failed to parse netlify.toml: ${err.message}
- The publish directory cannot be set to the site root. Please
- The _headers file should be placed in the project root rathe
AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02).
Data as JSON: /api/errors/76df442d12f61b43.
Report an issue: GitHub.