Skip to content

Commit

Permalink
Fix global is not defined on vercel edge (#6425)
Browse files Browse the repository at this point in the history
* Fix `global is not defined` on vercel edge

* Update packages/adapter-vercel/index.js

Co-authored-by: Rich Harris <hello@rich-harris.dev>
  • Loading branch information
juanvillacortac and Rich-Harris committed Aug 30, 2022
1 parent 863a546 commit 4b48d1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rare-wolves-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-vercel': patch
---

Fix `global is not defined` runtime error building with `edge: true` option
3 changes: 2 additions & 1 deletion packages/adapter-vercel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 4b48d1b

Please sign in to comment.