Skip to content

@basetenlabs/performance-client: every release after 0.0.10 is published without platform optionalDependencies (Cannot find native binding) #2590

Description

@shaper

Summary

Every @basetenlabs/performance-client release after 0.0.10 is published without its platform optionalDependencies, so require() fails with Cannot find native binding on every platform. The platform packages are built and present on npm — nothing declares a dependency on them, so no package manager installs them.

0.0.10 (2025-08-07) is the last usable release. The current latest, 0.1.2, has been broken since 2026-01-28.

Reproduction

mkdir /tmp/bt && cd /tmp/bt && npm init -y
npm i @basetenlabs/performance-client@0.1.2
node -e "require('@basetenlabs/performance-client')"
Error: Cannot find native binding. npm has a bug related to optional dependencies
(https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing
both package-lock.json and node_modules directory.
  [cause]: Error: Cannot find module '@basetenlabs/performance-client-darwin-arm64'
    cause: Error: Cannot find module './performance-client.darwin-arm64.node'

Reproduced on macOS arm64 with npm 11.6.2 and pnpm 10.33.4. Note that npm i reports added 1 package — no platform package is considered at all.

The error text blames the npm optional-dependency bug, but that isn't the cause here: there is no optional dependency for a package manager to skip.

Cause

optionalDependencies is absent from the published manifest:

$ npm view @basetenlabs/performance-client@0.0.10 optionalDependencies --json | jq 'length'
16
$ npm view @basetenlabs/performance-client@0.1.2 optionalDependencies --json
(empty)

Across every release since 0.0.10:

version published platform optionalDependencies
0.0.10 2025-08-07 16 ✅
0.0.18-rc0 2025-12-19 0 ❌
0.1.0 2025-12-20 0 ❌
0.1.1-rc0 2025-12-26 0 ❌
0.1.2 2026-01-28 0 ❌

The binaries themselves publish fine — @basetenlabs/performance-client-darwin-arm64@0.1.2 exists and works once fetched:

npm pack @basetenlabs/performance-client-darwin-arm64@0.1.2
# extract, drop performance-client.darwin-arm64.node into the main package dir
node -e "require('@basetenlabs/performance-client')"   # now succeeds

So napi prepublish -t npm is uploading the platform artifacts but not writing them back into the main package's manifest. Worth checking whether prepublishOnly is running at all in the release job, since napi prepublish is what injects that block — for example if publish uses --ignore-scripts, or if the main package is packed before the platform artifacts are collected.

Two smaller things visible in the same tarball, both consistent with the manifest not being regenerated at publish time:

  • 0.1.2 ships build inputs (Cargo.toml, build.rs, src/, .yarnrc.yml, benchmark_results_nodejs.csv) — there's no files field to limit the tarball.
  • 0.1.1 exists as a platform-package version but never as a main-package version, so the two are out of step.

Impact

0.1.x cannot be installed by any consumer on any platform. Anyone who already had 0.0.10 in a package-manager store keeps working after upgrading, which is likely why this has gone unreported for ~7 months — the failure only appears on a cold install.

We hit it while making this client an opt-in dependency of the Vercel AI SDK's Baseten provider (vercel/ai#18317) and have pinned our example to 0.0.10.

Suggested fix

Republish (e.g. 0.1.3) with the optionalDependencies block regenerated, and consider a post-publish smoke test that installs the tarball into an empty directory and require()s it — that would have caught all four releases.

Happy to verify a release candidate.

Activity

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