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
I just wanted to open a standard issue, but I couldn't found how, so I post here.
Background & Motivation
Just built my first site with Astro (migration from Gatsby).
It was a real pleasure to work with it, easy to learn, works great, big thanks to the whole team for this awesome work!
Problem
If found some strange behavior with env vars defined in astro.config.mjs env schema.
With static pages and some secret env vars, everything behaves correctly on dev and preview modes.
With ssr pages and some secret env vars, everything behaves correctly on dev mode, however on preview and production modes, runtime generation fails, claiming for those secret env vars while they don't use them in the code.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Body
Summary
I just wanted to open a standard issue, but I couldn't found how, so I post here.
Background & Motivation
Just built my first site with Astro (migration from Gatsby).
It was a real pleasure to work with it, easy to learn, works great, big thanks to the whole team for this awesome work!
Problem
If found some strange behavior with env vars defined in
astro.config.mjs
env schema.With static pages and some
secret
env vars, everything behaves correctly on dev and preview modes.With ssr pages and some
secret
env vars, everything behaves correctly on dev mode, however on preview and production modes, runtime generation fails, claiming for thosesecret
env vars while they don't use them in the code.Example
I use node
20.12.1
(not sure it's relevant here).Here is a minimal working example:
https://github.com/Fenykepy/astro-env-vars-example/blob/master/astro.config.mjs
(Please read README.md, I described everything)
[edit: sorry, did not post at the right place. Can someone delete this? Thanks.]
Beta Was this translation helpful? Give feedback.
All reactions