-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
p4-importantViolate documented behavior or significantly improves performance (priority)Violate documented behavior or significantly improves performance (priority)
Description
Describe the bug
I already reported this on Astro project, but was advised to do it here instead:
withastro/astro#14626
The tests work with Vitest 3, but after upgrade, I'm getting
TypeError: Cannot read properties of undefined (reading 'DEV')The line that throws the error is:
// node_modules/astro/dist/assets/runtime.js:12
if (import.meta.env.DEV) {
...
}import.meta.env should be standard Vite stuff, but it seems it doesn't always exist.
Reproduction
Just try to run tests (npm test), and you'll encounter the error.
System Info
System:
OS: macOS 15.6.1
CPU: (8) arm64 Apple M1 Pro
Memory: 295.80 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - /Users/x/.nvm/versions/node/v22.14.0/bin/node
npm: 10.9.2 - /Users/x/.nvm/versions/node/v22.14.0/bin/npm
Watchman: 2025.09.08.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 142.0.7444.60
Edge: 141.0.3537.99
Firefox: 139.0.4
Safari: 18.6
npmPackages:
@vitest/coverage-v8: ^4.0.4 => 4.0.4
@vitest/ui: ^4.0.4 => 4.0.4
vitest: ^4.0.4 => 4.0.4Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p4-importantViolate documented behavior or significantly improves performance (priority)Violate documented behavior or significantly improves performance (priority)