sigveh
sigveh
NNuxt
Created by sigveh on 6/2/2023 in #❓・help
Local SQLite file on server
Is it possible to store a local db.sqlite file in the server directory for a simple database? I get it working locally, but when deploying to Vercel it doesn't work. Here are the logs:
Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"TypeError: Cannot open database because the directory does not exist","reason":{"errorType":"TypeError","errorMessage":"Cannot open database because the directory does not exist","stack":["TypeError: Cannot open database because the directory does not exist"," at new Database (/var/task/node_modules/better-sqlite3/lib/database.js:59:9)"," at useDb (file:///var/task/chunks/nitro/vercel.mjs:490:20)"," at file:///var/task/chunks/nitro/vercel.mjs:498:11"," at createNitroApp (file:///var/task/chunks/nitro/vercel.mjs:654:5)"," at file:///var/task/chunks/nitro/vercel.mjs:658:18"," at ModuleJob.run (node:internal/modules/esm/module_job:194:25)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: TypeError: Cannot open database because the directory does not exist"," at process.<anonymous> (file:///var/runtime/index.mjs:1189:17)"," at process.emit (node:events:525:35)"," at emit (node:internal/process/promises:149:20)"," at processPromiseRejections (node:internal/process/promises:283:27)"," at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}
Unknown application error occurred
Runtime.Unknown
Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"TypeError: Cannot open database because the directory does not exist","reason":{"errorType":"TypeError","errorMessage":"Cannot open database because the directory does not exist","stack":["TypeError: Cannot open database because the directory does not exist"," at new Database (/var/task/node_modules/better-sqlite3/lib/database.js:59:9)"," at useDb (file:///var/task/chunks/nitro/vercel.mjs:490:20)"," at file:///var/task/chunks/nitro/vercel.mjs:498:11"," at createNitroApp (file:///var/task/chunks/nitro/vercel.mjs:654:5)"," at file:///var/task/chunks/nitro/vercel.mjs:658:18"," at ModuleJob.run (node:internal/modules/esm/module_job:194:25)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: TypeError: Cannot open database because the directory does not exist"," at process.<anonymous> (file:///var/runtime/index.mjs:1189:17)"," at process.emit (node:events:525:35)"," at emit (node:internal/process/promises:149:20)"," at processPromiseRejections (node:internal/process/promises:283:27)"," at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}
Unknown application error occurred
Runtime.Unknown
4 replies