Skip to content

Fix @libsql/client native dependency resolution for Vercel deployment#1116

Closed
Claude wants to merge 2 commits intomainfrom
claude/fix-api-error-deploy-vercel
Closed

Fix @libsql/client native dependency resolution for Vercel deployment#1116
Claude wants to merge 2 commits intomainfrom
claude/fix-api-error-deploy-vercel

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 13, 2026

Vercel deployment was failing with Cannot find module '@libsql/linux-x64-gnu' because the Turso driver's native binaries were not included in the serverless function package.

Root Cause

@libsql/client was marked for bundling in esbuild, but it depends on platform-specific native binaries (e.g., @libsql/linux-x64-gnu on Linux x64) that cannot be bundled. The deployment package lacked these runtime dependencies.

Changes

  • apps/studio/scripts/bundle-api.mjs: Mark @libsql/client as external (native bindings cannot be bundled)
  • apps/studio/scripts/build-vercel.sh: Copy entire @libsql/* scope to ensure all platform-specific binaries are included
  • apps/studio/vercel.json: Add @libsql to includeFiles pattern for serverless function packaging

This follows the same pattern already used for better-sqlite3 and @ai-sdk packages.

…ployment

- Mark @libsql/client as external in esbuild (cannot bundle native bindings)
- Copy entire @libsql scope to include platform-specific binaries
- Add @libsql to vercel.json includeFiles pattern

Fixes "Cannot find module '@libsql/linux-x64-gnu'" error on Vercel

Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/b0b587fe-a979-4361-8899-62cbc1fe5261

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectstack-play Error Error Apr 13, 2026 9:33am
spec Error Error Apr 13, 2026 9:33am

Request Review

…studio

Vercel serverless functions require external packages to be direct dependencies
in package.json, not just transitive workspace dependencies. Adding these
packages ensures they are properly installed and included in the deployment.

Related to: Cannot find package '@libsql/client' imported from /var/task/apps/studio/api/_handler.js

Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/4a0e5628-d026-4dab-ad6d-6ad619aeb571

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants