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
For both scripts PUBLIC_P=1 VITE_P=2 was set in environment, both those values are accessible during SSR, but only one of them is going to be ignored on client (depending on the way you run it).
Running npm run dev:
Running npm run build && npm run preview:
My explanation is that it seems like Astro is ignoring astro.vite configuration during builds, but uses it during dev
What version of
astro
are you using?1.9.1
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
change your configuration to add
vite.envPrefix
:For both scripts
PUBLIC_P=1 VITE_P=2
was set in environment, both those values are accessible during SSR, but only one of them is going to be ignored on client (depending on the way you run it).Running
npm run dev
:Running
npm run build && npm run preview
:My explanation is that it seems like Astro is ignoring
astro.vite
configuration during builds, but uses it during devLink to Minimal Reproducible Example
https://github.com/JLarky/astro-env-prefix-bug
Participation
The text was updated successfully, but these errors were encountered: