Skip to content

fix: correct undefined reference to global var with Vitest#9252

Merged
Rich-Harris merged 1 commit intomasterfrom
vitest-fix
Mar 1, 2023
Merged

fix: correct undefined reference to global var with Vitest#9252
Rich-Harris merged 1 commit intomasterfrom
vitest-fix

Conversation

@benmccann
Copy link
Member

Closes #9162

We should really add tests for this...

@Rich-Harris
Copy link
Member

Is there a way we can create this global when Vitest is running, rather than adding code to the bundle for everyone else?

@benmccann
Copy link
Member Author

We could probably change it to the code below, but it seems like it'd only save a byte or two after compression, so I don't know if it's even worth adding that complication?

const global = `${process.env.TEST ? 'globalThis.' : ''}__sveltekit_${version_hash}`;

@Rich-Harris Rich-Harris merged commit bd20531 into master Mar 1, 2023
@Rich-Harris Rich-Harris deleted the vitest-fix branch March 1, 2023 04:04
@github-actions github-actions bot mentioned this pull request Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vitest fails after SvelteKit Update: Cannot find package '__sveltekit'

2 participants