Error: Cannot find module '@libsql/darwin-arm64' when using Drizzle/SST
I'm using SST in a monorepo with Drizzle, and my Drizzle setup is in a separate workspace package.
When I try calling code that invokes the Drizzle client I get this error about missing a platform specific module:
This from this API handler in
apps/backend
:
With db
being exported from packages/database
here:
packages/database
has @libsql/client
as a dependency, nothing platform specific.
If I explicitly add @libsql/darwin-arm64
as a dependency to apps/backend
, then that works for local dev. When I deploy it, it complains about @libsql/linux-x64-gnu
of course, but this should just work without a hack like that, right?
I have a Next.js app running on Vercel (for now) also importing the database package and that works just fine.2 Replies
This also seems to happen without using a monorepo, when I have drizzle setup and schema files locally and all the right dependencies installed.
Looks like it's an issue with recent versions of @libsql/client per https://github.com/tursodatabase/libsql-client-ts/issues/112
I downgraded to @libsql/client 0.3.3 and it worked.
GitHub
"Runtime.ImportModuleError: Error: Cannot find module '@libsql/linu...
I was switching my database from planetscale to turso but I'm getting the following error { "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: ...