Skip to content

breaking: remove support for edge and node 20 runtimes - #16520

Merged
teemingc merged 10 commits into
version-3from
remove-edge-runtime
Jul 25, 2026
Merged

breaking: remove support for edge and node 20 runtimes#16520
teemingc merged 10 commits into
version-3from
remove-edge-runtime

Conversation

@Rich-Harris

Copy link
Copy Markdown
Member

The edge runtime has long since been deprecated (it confers no benefit; people should just use node on fluid compute, and SvelteKit 3 does not support Node 20


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@Rich-Harris Rich-Harris added the needs-platform-tests This PR needs to run platform tests in order to merge. label Jul 25, 2026
@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 25, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from fb2b32e:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/fb2b32ecc60ab4794702efea78debec474beef5c

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16520

@changeset-bot

changeset-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fb2b32e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/adapter-vercel Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread packages/adapter-vercel/utils.js
@svelte-docs-bot

Copy link
Copy Markdown

Comment thread packages/adapter-vercel/index.js Outdated
…th an empty config, so its `.vc-config.json` has no `runtime` field, which is required by Vercel's Build Output API.

This commit fixes the issue reported at packages/adapter-vercel/index.js:355

## Bug

In `packages/adapter-vercel/index.js`, the server-side route-resolution function (used when `kit.router.resolution === 'server'`) was generated as:

```js
await generate_serverless_function(`${builder.config.kit.appDir}/route`, {}, []);
```

`generate_serverless_function` calls `create_function_bundle(builder, ..., config)`, which writes `.vc-config.json` as:

```js
{
  runtime: config.runtime,   // <- undefined when config === {}
  ...
}
```

Since the config is an empty object, `config.runtime` is `undefined`. `JSON.stringify` drops `undefined` properties, so the generated `.func/.vc-config.json` has **no `runtime` field**.

### Trigger / failure mode
Any project deployed to Vercel with `kit.router.resolution: 'server'` produces a serverless `.func` for `${appDir}/route` without a `runtime`. Vercel's Build Output API requires a concrete runtime (e.g. `nodejs22.x`) for serverless functions, so the function is either rejected at deploy time or falls back to an unintended default.

Every other serverless function in this adapter passes a resolved runtime:
- Route groups: `const config = { ...defaults, ...route.config, runtime }` where `runtime = resolve_runtime(defaults.runtime, route.config.runtime)`.
- Catchall: `{ ...defaults, runtime }` where `runtime = resolve_runtime(defaults.runtime)`.

This function previously was an **edge** function that explicitly set `runtime: 'edge'`; after the migration to serverless the runtime was simply omitted.

## Fix

Resolve the runtime and spread `defaults`, matching the catchall pattern:

```js
const runtime = resolve_runtime(defaults.runtime);

await generate_serverless_function(
  `${builder.config.kit.appDir}/route`,
  /** @type {any} */ ({ ...defaults, runtime }),
  []
);
```

`resolve_runtime` is already imported from `./utils.js`, and it returns a valid `RuntimeKey` (e.g. `nodejs22.x`) or throws for unsupported runtimes — so the generated `.vc-config.json` now always contains a valid `runtime`. Also updated the stale "edge function" comment to "serverless function".

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: Rich-Harris <hello@rich-harris.dev>
@Nic-Polumeyv

Copy link
Copy Markdown
Contributor

ambient.d.ts still imports RequestContext, which no longer exists, and since the serverless entry never passes platform, the App.Platform.context declaration can go with it. With generate_edge_function gone, rolldown_config, the build import, files/edge.js and the rolldown dependency are all unused. The adapter docs page also still lists edge and nodejs20.x as runtimes. Can PR the cleanup against this branch if that's easier.

@Rich-Harris

Copy link
Copy Markdown
Member Author

good catches, thanks!

@Nic-Polumeyv Nic-Polumeyv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few leftovers. The troubleshooting section of the docs still describes edge functions: the fs paragraphs and the deployment protection section, which only applied to read fetching from the deployment on edge (the serverless entry uses createReadableStream). The config section in the page options docs also still opens with deploying parts of an app on the edge on Vercel as its example.

The runtime docs now list bun1.x, but RuntimeConfigKey only accepts experimental_bun1.x, so a typed config rejects the documented value. Vercel no longer labels the Bun runtime experimental, so this could become RuntimeKey | 'experimental_bun1.x', which the existing experimental_ strip already handles at runtime.

Comment thread packages/adapter-vercel/index.js Outdated
Comment thread packages/adapter-vercel/utils.js Outdated

@teemingc teemingc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. In the future, we should bump vercel/nft and add a platform test for bun

@teemingc
teemingc merged commit 9a95ecd into version-3 Jul 25, 2026
20 of 21 checks passed
@teemingc
teemingc deleted the remove-edge-runtime branch July 25, 2026 23:58
@Rich-Harris

Copy link
Copy Markdown
Member Author

the first of those is easy enough, at least #16522

Rich-Harris pushed a commit that referenced this pull request Jul 29, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to version-3, this PR
will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`version-3` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `version-3`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## @sveltejs/adapter-vercel@7.0.0-next.4

### Major Changes

- breaking: remove support for edge and Node 20 runtimes
([#16520](#16520))

### Patch Changes

- chore: bump `@vercel/nft` dependency
([#16522](#16522))
- Updated dependencies
[[`6942ddb`](6942ddb),
[`68137d4`](68137d4),
[`15dc603`](15dc603),
[`a4f1521`](a4f1521),
[`629b45d`](629b45d),
[`7a7833a`](7a7833a),
[`e6591a0`](e6591a0),
[`7a7833a`](7a7833a),
[`b196a39`](b196a39),
[`66bf343`](66bf343),
[`4bde76b`](4bde76b),
[`d9f05cb`](d9f05cb),
[`40efca1`](40efca1),
[`8ef5548`](8ef5548),
[`9efb8f2`](9efb8f2),
[`6a670dc`](6a670dc),
[`3416dcc`](3416dcc),
[`6850fa5`](6850fa5),
[`e6591a0`](e6591a0),
[`688bead`](688bead),
[`b596610`](b596610),
[`0f26c13`](0f26c13),
[`110a3db`](110a3db),
[`665d467`](665d467),
[`9c8c60c`](9c8c60c)]:
  - @sveltejs/kit@3.0.0-next.13
## @sveltejs/kit@3.0.0-next.13

### Major Changes

- breaking: replace the `noScroll` and `keepFocus` options of `goto`
with a single `reset` option, and the `data-sveltekit-noscroll` and
`data-sveltekit-keepfocus` attributes with `data-sveltekit-reset`
([#16558](#16558))

- breaking: deprecate `error(status, {...})` in favour of `error(status,
message, {...})` ([#16540](#16540))

### Minor Changes

- feat: add shallow routing to `goto` and deprecate `pushState` and
`replaceState` ([#16449](#16449))

- feat: preserve page state set through `goto(..., { state,
persistState: true })` across reloads
([#16449](#16449))

### Patch Changes

- chore: deduplicate repeated CSP directive handling
([#16498](#16498))

- fix: avoid Vite dev server reload on initial page request
([#16553](#16553))

- fix: don't set a `null` `accept-language` header on internal `fetch`
sub-requests when the incoming request has none
([#16527](#16527))

- fix: correctly detect prerendered paths in server `fetch` when
`paths.base` is set
([#16525](#16525))

- fix: don't duplicate remote modules in the generated manifest
([#16532](#16532))

- fix: exclude inlined files from the page's `$app/manifest` immutable
list ([#16531](#16531))

- perf: avoid quadratic remote form issue merging
([#16493](#16493))

- fix: don't attempt to serialize fetch responses when the request body
is not a string or TypedArray
([#16501](#16501))

- fix: read the error status of `App.Error` in the `prerender` and
`query.live` remote functions
([#16529](#16529))

- fix: propagate errors from prerendered remote responses instead of
re-running the function
([#16535](#16535))

- fix: respect the status returned from `handleError` on the fallback
error page served to error-page sub-requests
([#16528](#16528))

- fix: skip unnecessary `version.json` checks if `updated.current` is
already `true` ([#16518](#16518))

- fix: allow generation of $app/tsconfig without TypeScript installed
([#16534](#16534))

- perf: use a `Set` to check element ids when validating fragment links
during prerendering
([#16494](#16494))

- fix: only include `_app/immutable` files in `$app/manifest`'s
`immutable` in the service worker
([#16531](#16531))

- fix: log errors caught by the Vite dev server handler
([#16550](#16550))

- fix: resolve `root` per instance of the SvelteKit Vite plugin
([#16513](#16513))

- fix: ignore path casing differences when warning about overridden Vite
config on Windows ([#16545](#16545))

- fix: preserve the current URL search parameters when submitting a
remote form without JavaScript
([#16373](#16373))

- fix: treeshake prerendered remote functions in the right chunks
([#16533](#16533))

- fix: error during development if the adapter does not support
instrumentation and it exists
([#16548](#16548))
## @sveltejs/adapter-netlify@7.0.0-next.5

### Patch Changes

- chore: replace @netlify/functions with @netlify/types for the Context
type ([#16542](#16542))
- Updated dependencies
[[`6942ddb`](6942ddb),
[`68137d4`](68137d4),
[`15dc603`](15dc603),
[`a4f1521`](a4f1521),
[`629b45d`](629b45d),
[`7a7833a`](7a7833a),
[`e6591a0`](e6591a0),
[`7a7833a`](7a7833a),
[`b196a39`](b196a39),
[`66bf343`](66bf343),
[`4bde76b`](4bde76b),
[`d9f05cb`](d9f05cb),
[`40efca1`](40efca1),
[`8ef5548`](8ef5548),
[`9efb8f2`](9efb8f2),
[`6a670dc`](6a670dc),
[`3416dcc`](3416dcc),
[`6850fa5`](6850fa5),
[`e6591a0`](e6591a0),
[`688bead`](688bead),
[`b596610`](b596610),
[`0f26c13`](0f26c13),
[`110a3db`](110a3db),
[`665d467`](665d467),
[`9c8c60c`](9c8c60c)]:
  - @sveltejs/kit@3.0.0-next.13
## @sveltejs/adapter-static@4.0.0-next.2

### Patch Changes

- fix: match adapter-vercel's prerendered redirect handling when
deploying to Vercel
([#16497](#16497))
- Updated dependencies
[[`6942ddb`](6942ddb),
[`68137d4`](68137d4),
[`15dc603`](15dc603),
[`a4f1521`](a4f1521),
[`629b45d`](629b45d),
[`7a7833a`](7a7833a),
[`e6591a0`](e6591a0),
[`7a7833a`](7a7833a),
[`b196a39`](b196a39),
[`66bf343`](66bf343),
[`4bde76b`](4bde76b),
[`d9f05cb`](d9f05cb),
[`40efca1`](40efca1),
[`8ef5548`](8ef5548),
[`9efb8f2`](9efb8f2),
[`6a670dc`](6a670dc),
[`3416dcc`](3416dcc),
[`6850fa5`](6850fa5),
[`e6591a0`](e6591a0),
[`688bead`](688bead),
[`b596610`](b596610),
[`0f26c13`](0f26c13),
[`110a3db`](110a3db),
[`665d467`](665d467),
[`9c8c60c`](9c8c60c)]:
  - @sveltejs/kit@3.0.0-next.13

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-platform-tests This PR needs to run platform tests in order to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants