tursodatabase / libsql-client-ts

TypeScript/JavaScript client API for libSQL
https://docs.turso.tech/sdk/ts/quickstart
MIT License
289 stars 37 forks source link

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

Closed diboune closed 1 year ago

diboune commented 1 year ago

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.cjs
- /var/task/apps/web/build/build-nodejs-eyJydW50aW1lIjoibm9kZWpzIn0.js
Did you forget to add it to "dependencies" in `package.json`?
RequestId: 963e7577-fe2b-41be-80c8-e666c3c91b23 Error: Runtime exited with error: exit status 1
Runtime.ExitError
penberg commented 1 year ago

I temporarily reverted to better-sqlite3 until i get this fixed

penberg commented 1 year ago

@diboune can you please test 0.3.5-pre.2 with the following additional configuration:

https://github.com/libsql/libsql-client-ts#using-the-library-with-nextjs

The extra config is not needed if you use a version of Next with https://github.com/vercel/next.js/pull/55266 included.

diboune commented 1 year ago

I had this problem while using Remix.run, but yes it's now working in both of Vercel runtimes! thank you!

penberg commented 1 year ago

Thanks for reporting back, @diboune!

hamedmam commented 1 year ago

I just faced this issue with Lambda on AWS, any fix that's not specific to Vercel @penberg ?

penberg commented 1 year ago

@hamedmam Aah, I think I just answered you on X. Isn't importing @libsql/client/web working for you? It's the same API, but without the optional native dependency.

hugotox commented 1 year ago

Hello! I'm having the same issue trying to build a sveltekit app on vercel. I can't pass the build step, it fails with Error: Cannot find module '@libsql/linux-x64-gnu' I'm using "@libsql/client": "^0.3.5". Any advice?

Update I reverted back to version 0.3.2 and the issue is gone

@penberg I think this issue should be reopened