-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
import.meta.env
undefined after upgrade from 405 to 432
#6259
Comments
Possibly the same underlying reason as in #5952 |
I have been able to get around this (and related bugs) in Vitest by mocking // ./test/setup.ts
beforeAll(() => {
vi.mock('$app/env', () => ({
browser: 'window' in globalThis,
}))
}) |
@brev thanks a lot! Fixed my issue temporarily. |
+1 Dealing with the same issue |
I added the code snippet that @brev mentioned, and although it fixed some tests, I'm still getting a couple tests failing due to the same error. Any thoughts? P.S.: It's not the glob pattern that's wrong. Here is my vite config:
|
Tested after #6398 closed #5952, but this issue is still present. |
Oh, I just accidentally stumbled across this, related? https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%401.0.0-next.445
|
@brev Nope, implemented this but still broken on my end. |
Also broken here |
We're also seeing this issue |
Adding
to the |
Is this still happening? If so, we're going to need a repro — not a branch of an existing project, but a proper standalone minimal reproduction |
Closing as we don't have a minimal reproduction to work with. Feel free to open a new issue with a repro |
This was the solution for us https://vitest.dev/guide/in-source.html |
Describe the bug
import.meta.env
is undefined after upgrading to v432, causing vitest to fail.Reproduction
PR of the upgrade branch. Only contains changes for the upgrade.
Logs
System Info
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: