Skip to content

Commit bd20531

Browse files
authored
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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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)