import.meta.env and process.env not working in App.tsx #3290
Unanswered
basit-qayoom
asked this question in
Q&A
Replies: 3 comments 9 replies
-
You should always use see https://rsbuild.dev/guide/advanced/env-vars#identifiers-matching |
Beta Was this translation helpful? Give feedback.
0 replies
-
also see #3029 for more background and history |
Beta Was this translation helpful? Give feedback.
0 replies
-
It's not working with the full name on my side:
Then I got error: ![]() But I can successfully do ![]() |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
import.meta.env
andprocess.env
not working in App.tsxDescription
I'm encountering issues while trying to access environment variables in my
App.tsx
file.When I try to console
import.meta.env
, I receive the following TypeScript error:Property ‘env’ does not exist on type ‘ImportMeta’.ts(2339)
When attempting to console
process.env
, the browser shows:process is not defined
Steps to Reproduce
.env
file in the root directory.App.tsx
, add the following code:Beta Was this translation helpful? Give feedback.
All reactions