DT
Drizzle Team•10mo ago
babakfp

ERROR 500. SvelteKit + Drizzle + better-sqlite

Hi Deployed site: https://drizzle-test-test-test-hahaha.vercel.app Source code: https://github.com/babakfp/drizzle-test-test-test-hahaha ERROR MESSAGE:
SqliteError: unable to open database file
at new Database (/var/task/node_modules/better-sqlite3/lib/database.js:69:26)
at file:///var/task/.svelte-kit/output/server/entries/pages/_page.server.ts.js:4:16
at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
at async Promise.all (index 1)
at async render_page (file:///var/task/.svelte-kit/output/server/index.js:2025:19)
at async resolve2 (file:///var/task/.svelte-kit/output/server/index.js:2839:24)
at async respond (file:///var/task/.svelte-kit/output/server/index.js:2730:22)
at async Server.default (file:///var/task/.svelte-kit/vercel-tmp/index.js:39:3)
at async Server.<anonymous> (/opt/node-bridge/bridge-server-D2QTJ22O.js:1:8930) {
code: 'SQLITE_CANTOPEN'
}
SqliteError: unable to open database file
at new Database (/var/task/node_modules/better-sqlite3/lib/database.js:69:26)
at file:///var/task/.svelte-kit/output/server/entries/pages/_page.server.ts.js:4:16
at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
at async Promise.all (index 1)
at async render_page (file:///var/task/.svelte-kit/output/server/index.js:2025:19)
at async resolve2 (file:///var/task/.svelte-kit/output/server/index.js:2839:24)
at async respond (file:///var/task/.svelte-kit/output/server/index.js:2730:22)
at async Server.default (file:///var/task/.svelte-kit/vercel-tmp/index.js:39:3)
at async Server.<anonymous> (/opt/node-bridge/bridge-server-D2QTJ22O.js:1:8930) {
code: 'SQLITE_CANTOPEN'
}
Do I need to do something to get it working? Works with no problem on local
GitHub
GitHub - babakfp/drizzle-test-test-test-hahaha
Contribute to babakfp/drizzle-test-test-test-hahaha development by creating an account on GitHub.
2 Replies
Startup Spells 🪄 Newsletter Guy
that error means the database location is not created. so if you used a path like /data/users.sqlite & the path /data is not created on vercel then it will fail with this error ask the next.js guys where should you put sqlite path on vercel & if there's a place to put database files that are persisted on vercel. if you search vercel sqlite, you get good results https://www.google.com/search?q=vercel+sqlite
Startup Spells 🪄 Newsletter Guy
it says sqlite is not supported with vercel. makes sense as vercel pushes serverless down your throat https://vercel.com/guides/is-sqlite-supported-in-vercel
Is SQLite supported in Vercel?
Information about whether SQLite is supported in a serverless environment like Vercel.
Want results from more Discord servers?
Add your server