Skip to content

Commit 1bc22cd

Browse files
fix: add functions.includeFiles for native addons (better-sqlite3, @libsql/client) on Vercel
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/fbeefcaa-1bf8-418e-aed0-baafcf1b18aa Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent 6886a92 commit 1bc22cd

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
Added `createRequire` banner to the esbuild config so that CJS
2020
dependencies (knex/tarn) can `require()` Node.js built-in modules like
2121
`events` without the "Dynamic require is not supported" error.
22+
Added `functions.includeFiles` in `vercel.json` to include native addons
23+
(`better-sqlite3`, `@libsql/client`) that esbuild cannot bundle.
2224
Updated rewrites to match: `/api/:path*``/api/[[...route]]`.
2325
- **Studio CORS error on Vercel temporary/preview domains** — Changed
2426
`VITE_SERVER_URL` from hardcoded `https://play.objectstack.ai` to `""`

apps/studio/vercel.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
"VITE_SERVER_URL": ""
1010
}
1111
},
12+
"functions": {
13+
"api/**/*.js": {
14+
"memory": 1024,
15+
"maxDuration": 60,
16+
"includeFiles": "{node_modules/@libsql,node_modules/better-sqlite3}/**"
17+
}
18+
},
1219
"headers": [
1320
{
1421
"source": "/assets/(.*)",

0 commit comments

Comments
 (0)