3.0.0-beta.15
https://github.com/VladPavliuk/Client-games
I expect to use some variable wich defined in env files and see it value
Instead, I see undefined every time when I try to usesome custom env variable
As the doc says, only env vars starting with VUE_APP will be exposed to your client code.
I was having the same issue but the issue I was having was that I did not rebuild the project by stopping the development environment and re-running 'npm run serve'.
After an hour of frustration I figured it out. I was having a bad morning. The same may be happening to others who are expecting that the environment variables will be available after a hot-reload instead of re-building.
I was having the same issue but the issue I was having was that I did not rebuild the project by stopping the development environment and re-running 'npm run serve'.
For me it took a cople of restarts for this to apply. Even emptied the browser cache. Is there some expiration time? Very annoying feature.
I fixed it by running
npm run build
npm run dev
then it started reading the env values.
I found this issue too. I fixed by restart my notebook and re-run project again.
I was having the same issue but the issue I was having was that I did not rebuild the project by stopping the development environment and re-running 'npm run serve'.
After an hour of frustration I figured it out. I was having a bad morning. The same may be happening to others who are expecting that the environment variables will be available after a hot-reload instead of re-building.
This was my issue. Thank you.
variables should start with VUE_APP_*
Most helpful comment
I was having the same issue but the issue I was having was that I did not rebuild the project by stopping the development environment and re-running 'npm run serve'.
After an hour of frustration I figured it out. I was having a bad morning. The same may be happening to others who are expecting that the environment variables will be available after a hot-reload instead of re-building.