mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 06:53:14 +00:00
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:
parent
26f8fe91a9
commit
5b52e92d2d
2 changed files with 7 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue