Skip to content

fix VITE_URL bug not getting set#22

Merged
robmsmt merged 1 commit into
mainfrom
fix/vite-env-runtime-lookup
May 18, 2026
Merged

fix VITE_URL bug not getting set#22
robmsmt merged 1 commit into
mainfrom
fix/vite-env-runtime-lookup

Conversation

@robmsmt
Copy link
Copy Markdown
Contributor

@robmsmt robmsmt commented May 18, 2026

No description provided.

@robmsmt robmsmt merged commit 3eb99b7 into main May 18, 2026
2 checks passed
robmsmt added a commit that referenced this pull request May 18, 2026
PR #22 switched the SSR-side reads from import.meta.env to process.env to
support runtime container injection (deploy once, env var set per
container, no rebuild). That works in prod and dev deploys, but breaks
make dummy-run: Astro/Vite loads frontend/.env into import.meta.env
only — process.env is untouched. So locally the env var is invisible,
PageLayout falls back to the prod default, that prod URL gets baked
into window.__API_URL__ on every page, and the browser fetches prod.

Read both with process.env first: runtime container injection still
wins, but local .env now works too. No rebuild required for either
mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant