import.meta.env is undefined when used in ternary operator following a spread #11803
Closed
7 tasks done
Labels
bug: upstream
Bug in a dependency of Vite
p2-edge-case
Bug, but has workaround or limited in scope (priority)
Describe the bug
when
import.meta.env
is used in a ternary operator, following an array spread, vite can't seem to pick upimport.meta.env
is being used, and it becomes undefined.E.g.
will result in error:
However without the
...
spread seems to work ok.Please see the reproduction link.
Reproduction
https://stackblitz.com/edit/vitejs-vite-7mr8pa
Steps to reproduce
No response
System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 7.17.0 - /usr/local/bin/npm npmPackages: vite: 4.0.4 => 4.0.4
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: