fix: manage.sh must source .env before starting Vite so VITE_API_BASE and VITE_BASE_URL are active #24
Labels
No labels
a11y
backlog
blocked
bug
cf-core-dep
design
enhancement
infrastructure
internal
privacy
tier:free
tier:paid
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/linnet#24
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When
manage.sh restart(or the equivalent manualnpm run dev) is run without first sourcing.env, Vite starts with noVITE_API_BASEand noVITE_BASE_URL. This causes two silent failures:base: process.env.VITE_BASE_URL ?? "/"falls back to/, so the app serves at root instead of/linnet/. Assets load but the SPA is at the wrong path.import.meta.env.VITE_API_BASEis empty, so all fetch calls omit/linnetand hit e.g./session/startinstead of/linnet/session/start. Caddy has no route for the unprefixed path → redirects to auth → CORS error → session start fails.This was discovered 2026-04-13 when a plain
npm run dev -- --host 0.0.0.0 --port 8521started Vite without the env, producing a blank page / CORS failure through the cloud proxy.Fix
manage.shstartandrestartcommands must source.envbefore spawning the Vite process:Also verify
.env.exampleexists and is up to date so thecp .env.example .envfallback path in manage.sh works on a fresh clone.Acceptance
bash manage.sh restartstarts Vite withVITE_API_BASE=/linnetandVITE_BASE_URL=/linnet/visible in the process envhttps://menagerie.circuitforge.tech/linnet/after a clean restart with no manual env setup.env.examplepresent and includesVITE_BASE_URL,VITE_API_BASE,CF_ORCH_URL,CF_ORCH_AGENT_URL