-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
String 'import.meta.env' in Vue template breaks vite build #5086
Comments
same in react tsx file |
Possibly related: #2330 I'm seeing this error in react, svelte, and vue. (https://github.com/eirslett/storybook-builder-vite/pull/105/checks?check_run_id=3739457171) Edit: I've realized this only happens when I use the strings in ways that I expect to remain strings, for example:
Fails because it is being expanded into:
Whereas this is fine:
|
I think this might be a duplicate of #3304, in fact. |
Closing as duplicate of #3304 |
Describe the bug
After adding a new typed property to import.meta.env, adding the string
import.meta.env
breaks vite build. Dev server works normally, no TS errors.Reproduction
import.meta.env.VITE_APP_FOO
in scriptimport.meta.env
to template (Uninen/vite-importmetaenv-bug@d2e147c)vite build
Minimal reproduction here in the latest commit: https://github.com/Uninen/vite-importmetaenv-bug
(Clean vite template repo, first commit adds the code, second demonstrates the issue)
System Info
Used Package Manager
yarn
Logs
Validations
The text was updated successfully, but these errors were encountered: