Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run Libsql/Drizzle (Turso) in Remix hosted on Vercel #1739

Open
anthonyhagi opened this issue Sep 17, 2024 · 0 comments
Open

Unable to run Libsql/Drizzle (Turso) in Remix hosted on Vercel #1739

anthonyhagi opened this issue Sep 17, 2024 · 0 comments

Comments

@anthonyhagi
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant