Solution skill
Vercel Serverless Cannot find module '@libsql/linux-x64-gnu'
Complete solution
Libsql Client Ts: vercel Serverless Cannot find module '@libsql/linux-x64-gnu'. The verified fix is Fix: Next.js/Vercel: use the documented extra bundler config for Next.js ('Using the library with Next.js' in the README; not needed on newer Next with vercel/next.js#55266) - 0.3.5-pre.2 resolved it for the reporter on both Vercel runtimes. Use this when you hit the symptoms above in libsql-client-ts; not for unrelated libsql-client-ts errors or general setup questions.
TL;DR
Fix: Next.js/Vercel: use the documented extra bundler config for Next.js ('Using the library with Next.js' in the README; not needed on newer Next with vercel/next.js#(55266) - 0.3.5-pre.2 resolved it for the reporter on both Vercel runtimes.
The error
Issue tursodatabase/libsql-client-ts#84 (closed, 7 comments): After upgrading to @libsql/client@0.3.3-pre.2 it started giving me this error in the Vercel logs --- @libsql/client@0.3.2 works fine.Fix
- Next.js/Vercel: use the documented extra bundler config for Next.js ('Using the library with Next.js' in the README; not needed on newer Next with vercel/next.js#(55266) - 0.3.5-pre.2 resolved it for the reporter on both Vercel runtimes.
Success check: the symptom above is gone and the original operation completes.
When to use
- You hit this exact symptom in libsql-client-ts.
- You want the verified fix without digging through the thread.
When not to use
- A different error in libsql-client-ts, even a similar-looking one.
- General libsql-client-ts setup or credential questions.
Compatibility
- Libsql Client Ts (tursodatabase/libsql-client-ts)
Variant phrasings
- How to fix "vercel Serverless Cannot find module '@libsql/linux-x64-gnu'" in libsql-client-ts
- libsql-client-ts: vercel Serverless Cannot find module '@libsql/linux-x64-gnu'
Edge cases
- AWS Lambda / other serverless: import
@libsql/client/webinstead - same API without the optional native dependency, so no@libsql/linux-x64-gnumodule is ever required.
Source
- https://github.com/tursodatabase/libsql-client-ts/issues/84
Evidence
Asked in gh:tursodatabase/libsql-client-ts#84 (https://github.com/tursodatabase/libsql-client-ts/issues/84): Vercel Serverless Cannot find module '@libsql/linux-x64-gnu'. The issue report: Issue tursodatabase/libsql-client-ts#84 (closed, 7 comments): After upgrading to @libsql/client@0.3.3-pre.2 it started giving me this error in the Vercel logs --- @libsql/client@0.3.2 works fine.
Require stack:
- /var/task/node_modules/.pnpm/libsql@0.1.4/node_modules/libsql/index.js
- /var/task/node_modules/.pnpm/@libsql+client@0.3.3-pre.2/node_modules/@libsql/client/lib-cjs/sqlite3.js
- /var/task/node_modules/.pnpm/@libsql+client@0.3.3-pre.2/node_modules/@libsql/client/lib-cjs/node.js
- /var/task/node_modules/.pnpm/drizzle-orm@0.28.6_@libsql+client@0.3.3-pre.2/node_modules/drizzle-orm/libsql/index.cj The verified answer: [penberg (maintainer)]: Two fixes depending on environment. Next.js/Vercel: use the documented extra bundler config for Next.js ('Using the library with Next.js' in the README; not needed on newer Next with vercel/next.js#55266) - 0.3.5-pre.2 resolved it for the reporter on both Vercel runtimes. AWS Lambda / other serverless: import `@libsql/client/web` instead - same API without the optional native dependency, so no `@libsql/linux-x64-gnu` module is ever required.By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_z7PI3ZbxF64hpM1rnqeY9A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Vercel Serverless Cannot find module '@libsql/linux-x64-gnu' <span>— Vectle</span></a>