-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
process.argv
mismatching between 1.6.0
and 2.0.x
#6203
Comments
This probably happens because we want to statically replace testing-library's env vars: vitest/packages/browser/src/node/plugin.ts Line 339 in 883f348
But looks like adding Not sure how to fix this yet. |
In our project a deep dependency is looking for Until it's fixed, is there a workaround you could think of? |
I don't think this can be fixed soon on Vite side, but you can define export default defineConfig({
defines: {
'process.argv': '[]',
}
}) |
Looks like the previous fix breaks config bundling (esbuild hangs) with |
In my case I had to also add one other attribute to process. {
define: {
"process.argv": "[]",
"process.nextTick": "function noop(){}",
},
} |
Describe the bug
The default value for
process.argv
does not match between above mentioned versions, when run with thebrowsers
mode.1.6.0
it's was undefined2.0.x
it is an array with few valuesIf we use
vite-plugin-node-polyfills
to pollyfil theprocess
it had different weird behavior.1.6.0
it's was[]
2.0.x
it is undefinedThe
vite-plugin-node-polyfills
version is same in both cases, so the shims does not change at all.Reproduction
https://stackblitz.com/edit/vitest-2-env-argv
https://stackblitz.com/edit/vitest-1-env-argv
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: