fix: fail Vercel builds when VITE_DASHBOARD_API_BASE_URL is set

Signed-off-by: Adam Moussa <adam@seahavenind.com>
This commit is contained in:
Adam Moussa 2026-07-17 18:06:09 -04:00
parent 26f8fe91a9
commit 5b52e92d2d
No known key found for this signature in database
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(