Skip to content

Commit bd20531

Browse files
authoredMar 1, 2023
fix: correct undefined reference to global var with Vitest (#9252)
1 parent 1d45113 commit bd20531

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎.changeset/chilled-rivers-learn.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: correct undefined reference to global var with Vitest

‎packages/kit/src/exports/vite/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ function kit({ svelte_config }) {
334334

335335
async load(id, options) {
336336
const browser = !options?.ssr;
337-
const global = `__sveltekit_${version_hash}`;
337+
const global = `globalThis.__sveltekit_${version_hash}`;
338338

339339
if (options?.ssr === false && process.env.TEST !== 'true') {
340340
const normalized_cwd = vite.normalizePath(cwd);

0 commit comments

Comments
 (0)
Please sign in to comment.