You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need to have the variable defined at build-time in order for it to be available at runtime. For example VITE_ENV_TEST='' astro build. It will still be pulled from runtime. Try that and let me know if it resolves the problem.
What version of
astro
are you using?2.5.0
Are you using an SSR adapter? If so, which one?
Cloudflare 6.3.0
What package manager are you using?
npm
What operating system are you using?
Linux
What browser are you using?
Firefox
Describe the Bug
import.meta.env.MY_VAR is no longer defined at build time when deployed to Cloudflare.
Example I've included:
Deploy to Cloudflare and set the environment variables:
Once set and deployed only the process.env.ENV_TEST_TWO will render.
If you trust that I didn't mess anything up you can see the result deployed here:
https://astro-cf-test.pages.dev/
I've added some config options to get this process.env to work:
Is this expected/known?
Link to Minimal Reproducible Example
https://github.com/davycoe/astro_cf_test
Participation
The text was updated successfully, but these errors were encountered: