Skip to content

Pin the OTLP trace exporter so npm installs a working tree - #291

Merged
DavertMik merged 1 commit into
mainfrom
fix/otel-exporter-dependency
Nov 3, 2026
Merged

DavertMik merged 1 commit into
mainfrom
fix/otel-exporter-dependency

Conversation

@DavertMik

Copy link
Copy Markdown
Contributor

Problem

A fresh npm install -g explorbot@0.6.0 (and npx explorbot) crashes on start:

.../@opentelemetry/otlp-transformer/dist/logs/protobuf/logs-serializer.mjs:5
import { SeverityNumber } from "@opentelemetry/api";
SyntaxError: Named export 'SeverityNumber' not found. The requested module '@opentelemetry/api' is a CommonJS module

@langfuse/otel declares @opentelemetry/exporter-trace-otlp-http as a peer (>=0.202.0 <1.0.0). Explorbot doesn't list it, so npm auto-installs the newest match: 0.300.0 (released 2026-10-20), which needs @opentelemetry/api >=1.10.0 <1.11.0. The SDK explorbot is on (sdk-node 0.208, sdk-trace-base 2.x) needs api <1.10.0. npm keeps 1.9.1, warns ERESOLVE overriding peer dependency, and the exporter fails at import.

The repo works because bun.lock pins the exporter at 0.208.0, but npm never reads bun.lock. Older releases probably break the same way on a fresh install; installs cached before Oct 20 still work.

Fix

Add "@opentelemetry/exporter-trace-otlp-http": "^0.208.0" as a direct dependency, so the peer resolves to the line the rest of the SDK is on.

bun.lock is regenerated. Besides the new entry, bun drops the nested 0.205 exporter copies it no longer needs, and adds wrap-ansi, which main's package.json already listed but the lockfile was missing.

Verification

Took the published explorbot@0.6.0 tarball, added only this dependency, and installed it with npm install --global:

0.6.0 as published 0.6.0 + this change
ERESOLVE warnings 5 0
invalid @opentelemetry/api peers 65 0
exporter installed 0.300.0 0.208.0
explorbot --version crashes 0.6.0

bun test tests/unit: 1746 pass, 1 fail. The failure is enables Langfuse from LANGFUSE_* env vars, which fails on main too.

Moving the whole OpenTelemetry stack to the 0.300 / api 1.10 line is the longer-term fix. This PR is the smallest change that makes a publishable release.

🤖 Generated with Claude Code

`npm install explorbot` (and npx) crashed on start:

  SyntaxError: Named export 'SeverityNumber' not found.
  The requested module '@opentelemetry/api' is a CommonJS module

@langfuse/otel takes @opentelemetry/exporter-trace-otlp-http as a peer
(">=0.202.0 <1.0.0"). Explorbot did not list it, so npm installed the
newest match, 0.300.0, which needs @opentelemetry/api >=1.10. The
OpenTelemetry SDK explorbot uses (0.208 / 2.x) needs api <1.10, so npm
kept 1.9.1 and the exporter failed to load. bun.lock pinned 0.208.0,
which is why the repo itself worked.

List the exporter at ^0.208.0, the line the rest of the SDK is on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavertMik
DavertMik merged commit e110a7f into main Nov 3, 2026
2 checks passed
@DavertMik
DavertMik deleted the fix/otel-exporter-dependency branch November 3, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant