Skip to content

[v2.20.0] Build fails with adapter-vercel and edge runtime #13598

@f-elix

Description

@f-elix

Describe the bug

In version 2.20.0, using adapter-vercel with the runtime: 'edge' option, the build fails with the following error:

 Top-level await is not available in the configured target environment ("es2020")

Reproduction

Go to https://stackblitz.com/edit/sveltejs-kit-template-default-t41fd9vn?description=The%20default%20SvelteKit%20template,%20generated%20with%20create-svelte&file=svelte.config.js&title=SvelteKit%20Default%20Template and run npm run build.

Removing runtime: 'edge' fixes it, as well as reverting to sveltekit version 2.19.2.

Logs

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (6) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^4.0.0 => 4.0.0 
    @sveltejs/adapter-vercel: ^5.6.3 => 5.6.3 
    @sveltejs/kit: ^2.20.0 => 2.20.0 
    @sveltejs/vite-plugin-svelte: ^5.0.0 => 5.0.3 
    svelte: ^5.0.0 => 5.23.1 
    vite: ^6.0.0 => 6.2.2

Severity

blocking an upgrade

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions