Merge pull request #209 from Sea-Haven-Industries/chore/correct-ui-console-warning

chore: fail Vercel builds when VITE_DASHBOARD_API_BASE_URL is set
This commit is contained in:
Adam Moussa 2026-07-17 18:20:18 -04:00 • committed by GitHub
commit f70e284408
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View file

@ -10,10 +10,6 @@ const API_BASE = (import.meta.env.VITE_DASHBOARD_API_BASE_URL ?? "").replace(
""
)
if (!API_BASE && typeof window !== "undefined") {
console.warn("VITE_DASHBOARD_API_BASE_URL is not set")
}
const GITHUB_IMAGE_HOST_RE =
/^(?:www\.)?github\.com$|\.githubusercontent\.com$/i

View file

@ -92,6 +92,13 @@ function backendProxyRouteRules():
// ship a build whose API calls 404, which is exactly how the previous approach broke.
const onVercel =
!!process.env.VERCEL || process.env.NITRO_PRESET === "vercel"
if (onVercel && process.env.VITE_DASHBOARD_API_BASE_URL) {
throw new Error(
"VITE_DASHBOARD_API_BASE_URL must not be set on Vercel builds - the API is " +
"same-origin via the LANGGRAPH_BACKEND_URL CDN proxy. A baked-in absolute " +
"API base sends OAuth logins to the backend host and breaks the state cookie.",
)
}
if (!backend) {
if (onVercel) {
throw new Error(