-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
import.meta.env.PROD
will always have the value true.
It will only be false if I stub it to empty string ''
, but that's definitely not ideal.
Seems there's an issue when converting the string into a boolean (maybe !!
is used straight away without checking for special value e.g. string 'false'
)
I don't have enough time to find the regression commit (it's working as expected before) and the exact logic in the code base, but please get this fixed, thanks🙏
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-ckneff?file=test%2Fbasic.test.ts
System Info
System:
OS: Windows 11 10.0.22631
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Memory: 5.85 GB / 31.69 GB
Binaries:
Node: 20.11.0 - C:\Program Files\nodejs\node.EXE
npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
pnpm: 8.6.9 - ~\AppData\Local\pnpm\pnpm.EXE
Browsers:
Edge: Chromium (123.0.2420.81)
Internet Explorer: 11.0.22621.1
npmPackages:
@vitejs/plugin-react-swc: ^3.6.0 => 3.6.0
@vitest/coverage-istanbul: ^1.5.0 => 1.5.0
@vitest/coverage-v8: ^1.5.0 => 1.5.0
@vitest/ui: ^1.5.0 => 1.5.0
vite: ^5.2.8 => 5.2.8
vitest: ^1.5.0 => 1.5.0
Used 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.
MichailShcherbakov
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)