tursodatabase / tursodatabase/libsql
Unable to run Libsql/Drizzle (Turso) in Remix hosted on Vercel
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 17.2k
- Forks
- 531
- Avg merge
- 1h 12m
- Merged PRs (30d)
- 1
Description
The last working version I've been able to use is v0.5.2 with Remix + Drizzle (Libsql/Turso) + Vercel. The last time I looked into this, it was an issue with Vercel patching fetch weirdly that caused issues, yet this seems to be an issue now.
My keys are definitely valid as I can connect to Turso using TablePlus, although cannot connect through Vercel.
This is the error that occurs when trying to run a DB query in Vercel:
LibsqlError: SERVER_ERROR: Server returned HTTP status 401
at mapHranaError (file:///var/task/node_modules/@libsql/client/lib-esm/hrana.js:268:16)
at file:///var/task/node_modules/@libsql/client/lib-esm/http.js:76:23
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async LibSQLPreparedQuery.all (file:///var/task/node_modules/drizzle-orm/libsql/session.js:114:18)
at async getSession (file:///var/task/build/server/nodejs-eyJydW50aW1lIjoibm9kZWpzIn0/index.js:923:16)
at async getLoggedInUser (file:///var/task/build/server/nodejs-eyJydW50aW1lIjoibm9kZWpzIn0/index.js:980:19)
at async requireLoggedIn (file:///var/task/build/server/nodejs-eyJydW50aW1lIjoibm9kZWpzIn0/index.js:997:18)
at async loader$h (file:///var/task/build/server/nodejs-eyJydW50aW1lIjoibm9kZWpzIn0/index.js:1785:3)
at async Object.callRouteLoader (/var/task/node_modules/@remix-run/server-runtime/dist/data.js:59:16)
at async /var/task/node_modules/@remix-run/router/dist/router.cjs.js:4724:19 {
code: 'SERVER_ERROR',
rawCode: undefined,
[cause]: HttpServerError: Server returned HTTP status 401
at errorFromResponse (file:///var/task/node_modules/@libsql/hrana-client/lib-esm/http/stream.js:352:16)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
status: 401
}
}
If you need more details / a small repo to reproduce the issue, let me know.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported stack: Remix, Drizzle, LibSQL/Turso, and Vercel, then inspect the @libsql/client/lib-esm/http.js and hrana.js frames from the trace. Reproduce the database query on Vercel using the reported versions and compare it with v0.5.2; done means identifying why the deployment receives HTTP 401 and documenting or correcting the failing integration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, sqlite
- Domain
- cloud, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100