You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: follow hotcrm Vercel deployment pattern for API function detection
Adapts the studio's Vercel deployment to match the proven hotcrm pattern:
1. Created committed `api/[[...route]].ts` catch-all route so Vercel can
detect it as a serverless function during pre-build phase.
2. Changed esbuild output format from CJS to ESM — the studio's package.json
has "type": "module", which causes Node.js to parse .js files as ESM.
The previous CJS output (require/module.exports) would fail to parse.
3. Changed esbuild output path from `api/index.js` to `api/[[...route]].js`
matching the catch-all naming convention used by hotcrm.
4. Updated vercel.json rewrites from `/api/(.*)` → `/api` to
`/api/:path*` → `/api/[[...route]]` matching the hotcrm pattern.
5. Removed `outputDirectory: "public"` — Vercel's default for framework:null
already serves static from public/ and functions from api/ at project root.
6. Reverted build-vercel.sh to original (no copy-to-public/api step).
Reference: https://github.com/objectstack-ai/hotcrm/blob/main/vercel.json
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/15dce836-8636-4011-9192-87275ec8c7ce
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
0 commit comments