diff --git a/.changeset/rare-wolves-deliver.md b/.changeset/rare-wolves-deliver.md new file mode 100644 index 000000000000..a9a669e5edc7 --- /dev/null +++ b/.changeset/rare-wolves-deliver.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-vercel': patch +--- + +Fix `global is not defined` runtime error building with `edge: true` option diff --git a/packages/adapter-vercel/index.js b/packages/adapter-vercel/index.js index 0d0ba443385c..37027c836f7a 100644 --- a/packages/adapter-vercel/index.js +++ b/packages/adapter-vercel/index.js @@ -189,7 +189,8 @@ export default function ({ external = [], edge, split } = {}) { platform: 'browser', format: 'esm', external, - sourcemap: 'linked' + sourcemap: 'linked', + banner: { js: 'globalThis.global = globalThis;' } }); write(