-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
improve or update documentationEnhance / update existing documentation (e.g. add example, improve description, update for changes)Enhance / update existing documentation (e.g. add example, improve description, update for changes)
Description
📚 Subject area/topic
astro:env
📋 Page(s) affected (or suggested, for new content)
https://docs.astro.build/en/guides/environment-variables/
📋 Description of content that is out-of-date or incorrect
See #14504 for context. If you are in such situation:
- You have public and secret server vars
- You do not use secrets on prerendered pages
- You use public server vars on prerendered pages
- You do not provide secrets during the build since they're not technically required
- You do not have
env.validateSecrets: true
Then an error will be thrown saying that your secrets are missing. That's because as soon as the astro:env/server module is imported, even secrets are evaluated. There's nothing we can do about it unfortunately.
Solution is to pass fake values during the build to avoid errors.
🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)
No response
Metadata
Metadata
Assignees
Labels
improve or update documentationEnhance / update existing documentation (e.g. add example, improve description, update for changes)Enhance / update existing documentation (e.g. add example, improve description, update for changes)