sveltejs/kit · error · Error

The `edge` runtime is no longer supported

Error message

The `edge` runtime is no longer supported

What it means

adapter-vercel no longer supports the Vercel Edge runtime. Passing `edge` (as a truthy key or as runtime: 'edge') in the adapter options in svelte.config.js throws immediately in the plugin function before any adaptation begins.

Source

Thrown at packages/adapter-vercel/index.js:15

import fs from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { fileURLToPath } from 'node:url';
import { VERSION } from '@sveltejs/kit';
import { nodeFileTrace } from '@vercel/nft';
import { parse_isr_expiration, pattern_to_src, resolve_runtime } from './utils.js';

const INTERNAL = '![-]'; // this name is guaranteed not to conflict with user routes

/** @type {typeof import('./index.js').default} **/
const plugin = function (defaults = {}) {
	// @ts-ignore TODO remove this in a future version
	if ('edge' in defaults || defaults.runtime === 'edge') {
		throw new Error('The `edge` runtime is no longer supported');
	}

	return {
		name: '@sveltejs/adapter-vercel',
		/** @param {import('@sveltejs/kit').Builder} builder */
		async adapt(builder) {
			const dir = '.vercel/output';
			const tmp = builder.getBuildDirectory('vercel-tmp');

			fs.rmSync(dir, { force: true, recursive: true });
			fs.rmSync(tmp, { force: true, recursive: true });

			if (fs.existsSync('vercel.json')) {
				const vercel_file = fs.readFileSync('vercel.json', 'utf-8');
				const vercel_config = JSON.parse(vercel_file);
				validate_vercel_json(builder, vercel_config);
			}

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Remove the `edge` / `runtime: 'edge'` options from the adapter config in svelte.config.js
  2. Let the adapter pick a supported runtime (nodejsXX.x or bun1.x) by omitting `runtime`
  3. If per-route edge behavior is required, that is no longer available — deploy with the Node.js runtime or use a platform that supports edge
  4. Pin an older adapter version only as a temporary measure (not recommended, unsupported)

Example fix

// before
export default adapter({ runtime: 'edge' });
// after
export default adapter();
Defensive patterns

Strategy: validation

Validate before calling

// svelte.config.js pre-check
const opts = { /* your options */ };
if ('edge' in opts || opts.runtime === 'edge') {
  throw new Error('edge runtime is unsupported; remove it before building');
}

Type guard

const usesEdge = (opts = {}) => 'edge' in opts || opts.runtime === 'edge';

Try / catch

try {
  await vite.build();
} catch (err) {
  if (err.message.includes('edge` runtime is no longer supported')) {
    console.error('Remove edge/edge-runtime options from adapter-vercel config.');
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling the adapter factory as `vercel({ edge: true })` or `vercel({ runtime: 'edge' })` in svelte.config.js.

Common situations: Following an old tutorial or a pre-migration project file that configured edge deployment; upgrading @sveltejs/adapter-vercel from a version that supported edge; copy-pasting a config from a different project.

Related errors


AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02). Data as JSON: /api/errors/e5e9327a1a32bcf7. Report an issue: GitHub.