Skip to content
The Export That Vanished in a Minor Release

23 October 2026 · 2 min read

The Export That Vanished in a Minor Release

ci-cdtestingnodejs

The CI for a small cover-image CLI had been green on 4 October. On 19 October it was red, and nothing in the repository had changed. The failing step was the smoke test, and the message was clear: "Chromium is not installed. First-run setup: blog-cover-generator install-browser."

Except the browser install step had just run, and passed.

The test that resolves its own dependencies#

The smoke test packs the project, installs the tarball into an empty directory and runs the installed CLI, which is exactly what a new user does. That detail matters: an empty directory has no lockfile, so it resolves the newest version each range allows. The repository's lockfile had playwright-core 1.63.0; the consumer resolved 1.64.1, because the range is ^1.61.1. The project's own tests were exercising one version while the smoke test, and every real user, got another.

An error message that guessed#

The launch code mapped any failure matching browserType.launch to "Chromium is not installed". That regex is far wider than the one case it describes, so it hid the actual problem. I changed it so only a missing executable gets the install hint, and any other launch failure shows the first line of the real error.

The real cause#

Running the installed CLI's install-browser command with the newer version produced: Package subpath './cli.js' is not defined by "exports". The command located Playwright's CLI with require.resolve('playwright-core/cli.js'), and in the version a fresh install now resolves, that subpath is not in the package's exports map. This hit real users on their first run, not just CI.

The fix#

  • Resolve the CLI from the always-exported package.json, then build the path to cli.js from its directory.
  • Make the smoke test run install-browser itself, so it downloads the Chromium that matches the consumer's own playwright-core instead of leaning on the lockfile's browser.

I ran the smoke test locally against a fresh consumer before pushing, then watched CI go green.

Takeaways#

Reaching into a dependency's internal paths is borrowing against a stability promise the package never made. And a test that installs like a user is worth keeping precisely because it disagrees with your lockfile sometimes.