All my .env variables seem suddenly undefined. Did something change internally?
I'm on pages & nuxt
11 Replies
This was the issue. The new comp date removes all my env variables. Does anyone knows why?
Hey cosbgn, tried to reproduce this locally by following these steps, but wasn't successful:
- Create new pages project using 2024-06-03 for compat date
- Uploaded assets
- Added a variable in dash
- Updated toml to use 2024-09-02 compat date
- Reuploaded assets
- Visually see in dash variables are still present
Can you readily reproduce this with a new project and let us know the steps you took?
They are present also for me in the dashboard
They show up as before
But when my code runs and tries to access some it throws an error as it's undefined
I use nuxt3 and I use them as process.env.VAR_NAME which has always worked for me
Can you try to run a function to see if the code can read them?
In the middle of an incident at the moment, I will try to give this a go when I come up for air!
Heya, having the same issue as of today, during the build process, env variables are now set to none.
Yesterday, everything worked as expected and the secret showed up in the variables during the build process
I made no changes to the vars, wrangler file or the code, my compat date is set to
2024-09-24
The vars still show up in the settings as well, have not found a way to reproduce unfortunately
I guess I did change the root directory from /
to /frontend
, that is the only difference between the two deploymentsRevert your compat date back to 2024-09-22 or earlier
There's a known issue with Nuxt and the new nodejs compat v2 behaviour
hmmm that didnt work unfortunately
deleted the project and re-deployed, works again
Any way to get this working? It's been almost a week and I can't deploy my nuxt app (I need the comp flag for postgres). I just tried and it's still all undefined.
The workaround I currently use is to just delete the project from my account and then make a new one whenever I add a new env variable
Its very tedious but it works
If your page is already live and being used this wouldnt be much of an option ofc