Skip to content

Commit 3f02c08

Browse files
hotlongCopilot
andcommitted
fix(objectos vercel): include @objectstack/dashboard SPA in deployment
The dashboard SPA (apps/dashboard) was never copied into Vercel's public/ directory and had no rewrite/redirect/headers entries in vercel.json, so https://crm.objectstack.ai/_dashboard returned 404. - build-vercel.sh: build @objectstack/dashboard and copy dist to public/_dashboard/ - vercel.json: add /_dashboard rewrite, redirect, and asset cache headers Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d6bb2fb commit 3f02c08

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

apps/objectos/scripts/build-vercel.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo "[build-vercel] Starting server build..."
2121
# 1. Build the project with turbo (from monorepo root)
2222
# This builds server, studio, and the account portal.
2323
cd ../..
24-
pnpm turbo run build --filter=@objectstack/objectos --filter=@objectstack/studio --filter=@objectstack/account
24+
pnpm turbo run build --filter=@objectstack/objectos --filter=@objectstack/studio --filter=@objectstack/account --filter=@objectstack/dashboard
2525
cd apps/objectos
2626

2727
# 1b. Compile objectstack.config.ts → dist/objectstack.json (the metadata artifact).
@@ -68,6 +68,17 @@ else
6868
echo "[build-vercel] ⚠ Account dist not found (skipped)"
6969
fi
7070

71+
# 3c. Copy the dashboard SPA to public/_dashboard/ — same pattern as studio.
72+
# Dashboard is built with base: '/_dashboard/'.
73+
echo "[build-vercel] Copying dashboard dist to public/_dashboard/..."
74+
mkdir -p public/_dashboard
75+
if [ -d "../dashboard/dist" ]; then
76+
cp -r ../dashboard/dist/. public/_dashboard/
77+
echo "[build-vercel] ✓ Copied dashboard dist to public/_dashboard/"
78+
else
79+
echo "[build-vercel] ⚠ Dashboard dist not found (skipped)"
80+
fi
81+
7182
# 4. Install external dependencies in api/node_modules/ (no symlinks)
7283
# pnpm uses symlinks in node_modules/, which Vercel's serverless function
7384
# packaging cannot handle ("invalid deployment package" error).

apps/objectos/vercel.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,24 @@
2727
"headers": [
2828
{ "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }
2929
]
30+
},
31+
{
32+
"source": "/_dashboard/assets/(.*)",
33+
"headers": [
34+
{ "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }
35+
]
3036
}
3137
],
3238
"redirects": [
3339
{ "source": "/", "destination": "/_studio/", "permanent": false },
3440
{ "source": "/_studio", "destination": "/_studio/", "permanent": false },
35-
{ "source": "/_account", "destination": "/_account/", "permanent": false }
41+
{ "source": "/_account", "destination": "/_account/", "permanent": false },
42+
{ "source": "/_dashboard", "destination": "/_dashboard/", "permanent": false }
3643
],
3744
"rewrites": [
3845
{ "source": "/api/:path*", "destination": "/api/[[...route]]" },
3946
{ "source": "/_studio/:path*", "destination": "/_studio/index.html" },
40-
{ "source": "/_account/:path*", "destination": "/_account/index.html" }
47+
{ "source": "/_account/:path*", "destination": "/_account/index.html" },
48+
{ "source": "/_dashboard/:path*", "destination": "/_dashboard/index.html" }
4149
]
4250
}

0 commit comments

Comments
 (0)