I want to use env variables in a React project CRA-4.0.3 with Typescript.
I did try many approaches(here, here, here , and some other) using dotenv, webpack and suggestions from different sources but I still get undefined.
But, I still get undefined, can someone point me in the right direction? I already spend a reasonable amount of time.
Update: I forgot to mention that I want them to be available in runtime, so, I can use them for E2E Test with Playwright and Jest as runner.
I'm using them in a structure like this /main/e2e/tests/file.spec.ts
.env
REACT_APP_ADMINUSER=user REACT_APP_ADMINPASS=pass
Thanks in advance