-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment Variables for integrations can be handled different than Astro #10757
Comments
Thanks for filing this issue! I'll ask @florian-lefebvre to have a look here, since it seems like Cloudflare conflicts with otherwise how we suggest that environment variables work. |
Yeah I think we need to provide some clarifications because it's a common source of support threads and issues:
Hope that helps, I don't know where all this info should live but I think we need to provide more info, especially n°2 |
Yeah, this all sounds like helpful context. Do our three adapters (Node, Vercel, Netlify) all work the same (or mostly the same), and of our official adapters, Cloudflare is the only different one? In that case, it might be worth a specific Cloudflare section that could either be on this page, or a mention as a link to the Cloudflare adapter docs. If they're all a little different, then maybe a section for each one is needed, either on the Environment variable page or on each adapter page. Because this is a common source of confusion/issues, I'll put help wanted on this and we are happy to have people work on this! |
I'd say:
|
@sarah11918 i would like to work on this. |
FYI withastro/astro#13444 will probably make some of the info I shared here before outdated |
📚 Subject area/topic
environment variables
📋 Page(s) affected (or suggested, for new content)
https://docs.astro.build/en/guides/environment-variables/
https://docs.astro.build/en/guides/integrations-guide/cloudflare/#cloudflare-runtime
📋 Description of content that is out-of-date or incorrect
The Astro docs say that the environment variables can be set using a .env file. Cloudflare and its Wrangler tool use .dev.vars instead if that one.
The Astro docs say that environment variables can be read using the import.meta.env object. When running on Cloudflare, however, the Cloudflare integration places them on the Astro.locals.runtime.env object, or the context.locals.runtime.env object in endpoints.
🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)
No response
The text was updated successfully, but these errors were encountered: