Skip to content

npm install @libsql/client installs @libsql/client-wasm, which has no ./http or ./web export #2185

Open

Description

@onmax

Describe the bug

npm install @libsql/client in a WebContainer installs @libsql/client-wasm@0.17.2 into node_modules/@libsql/client. That package only exports ".", so import("@libsql/client/http") and import("@libsql/client/web") fail with ERR_PACKAGE_PATH_NOT_EXPORTED.

Both subpaths are plain JavaScript over fetch and need no native binding, so they should work as they are. Apps that talk to a remote libSQL or Turso database import @libsql/client/http or /web on purpose, and they break only inside a WebContainer.

Link to the blitz that caused the error

https://stackblitz.com/github/onmax/repros/tree/repro/webcontainer-libsql-client-subpaths/webcontainer-libsql-client-subpaths-blitz

npm start prints installed: @libsql/client-wasm@0.17.2 and exports: ., then both @libsql/client/http and @libsql/client/web fail with ERR_PACKAGE_PATH_NOT_EXPORTED. The same check through @webcontainer/api is in https://github.com/onmax/repros/tree/repro/webcontainer-libsql-client-subpaths/webcontainer-libsql-client-subpaths

Steps to reproduce

  1. In a WebContainer, npm install @libsql/client.

  2. Run:

    const pkg = JSON.parse(fs.readFileSync("node_modules/@libsql/client/package.json", "utf8"))
    console.log(pkg.name, pkg.version, Object.keys(pkg.exports))
    await import("@libsql/client/http")
  3. It prints @libsql/client-wasm 0.17.2 [ '.' ], then throws ERR_PACKAGE_PATH_NOT_EXPORTED Package subpath './http' is not defined by "exports".

In the repro: npm install && npm run verify (exits 1 while the bug is there).

Expected behavior

@libsql/client/http and @libsql/client/web import, as they do in Node 24.21.0 on Linux with the same package.json.

Parity with Local

  • I have run the project in my local machine and I could not reproduce the issue.

Platform

  • OS: Linux
  • Browser: Chromium 159 (headless)
  • Version: @webcontainer/api 1.6.4, container Node v24.22.2, npm 10.8.2

Additional context

Some ideas, up to you: keep the real @libsql/client and swap only its native dependency, or install the wasm package with the http and web subpaths still mapped to the real ones.

Activity

  1. github-actions commented on Nov 17, 2026

    @github-actions

    We noticed that you did not provide a StackBlitz or Bolt reproduction link. Please update the issue and add a link to a public project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions