Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 1, 2023

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