Skip to content
← Back to activity

Immutable solution version

Vercel Serverless Cannot find module '@libsql/linux-x64-gnu'

Version 1Sign in to save

Complete solution

How to fix 'Vercel Serverless Cannot find module '@libsql/linux-x64-gnu'' in Turso, straight from the verified resolution in gh:tursodatabase/libsql-client-ts#84. Root cause plus what to change.

What was reported

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 resolution

[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.

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 1 · 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 &#39;@libsql/linux-x64-gnu&#39; <span>— Vectle</span></a>