Description
@hyperdx/node-opentelemetry@0.11.0 fails immediately when imported after a clean installation.
The failure happens before calling initSDK and can be reproduced without Next.js, a bundler, or any HyperDX configuration.
@hyperdx/node-opentelemetry@0.10.5 loads successfully under the same environment.
Minimal reproduction
mkdir hyperdx-repro
cd hyperdx-repro
npm init -y
npm install @hyperdx/node-opentelemetry@0.11.0
node -e "require('@hyperdx/node-opentelemetry')"
The issue is also reproducible with pnpm:
pnpm add @hyperdx/node-opentelemetry@0.11.0
node -e "require('@hyperdx/node-opentelemetry')"
Actual behavior
Error: Cannot find module '@opentelemetry/sdk-trace-base/build/src/enums'
Require stack:
- node_modules/@hyperdx/instrumentation-sentry-node/build/src/eventProcessor.js
- node_modules/@hyperdx/instrumentation-sentry-node/build/src/index.js
- node_modules/@hyperdx/instrumentation-exception/build/src/index.js
- node_modules/@hyperdx/node-opentelemetry/build/src/otel.js
- node_modules/@hyperdx/node-opentelemetry/build/src/index.js
Expected behavior
The package should load successfully after a clean installation:
require('@hyperdx/node-opentelemetry');
Environment
- Node.js: 22.18.0
- npm: 11.5.2
- pnpm: 9.1.2
- OS: Linux x86_64
@hyperdx/node-opentelemetry: 0.11.0
- Resolved
@opentelemetry/sdk-trace-base: 2.9.0
Analysis
@hyperdx/instrumentation-sentry-node@0.2.0 imports an internal OpenTelemetry module:
import { ExceptionEventName } from '@opentelemetry/sdk-trace-base/build/src/enums';
@hyperdx/node-opentelemetry@0.11.0 declares:
"@opentelemetry/sdk-trace-base": "^2.7.1"
A clean installation currently resolves that range to 2.9.0.
The internal build/src/enums module exists in sdk-trace-base@2.7.1, but no longer exists in 2.9.0, causing the package import to fail.
The problem appears to be caused by relying on an internal OpenTelemetry path together with a non-pinned dependency range.
Verified workarounds
Pinning sdk-trace-base to 2.7.1 makes version 0.11.0 load successfully:
npm install --save-exact @opentelemetry/sdk-trace-base@2.7.1
Downgrading HyperDX also works:
npm install @hyperdx/node-opentelemetry@0.10.5
Suggested fix
Avoid importing from the private build/src/enums path and use a public API or semantic-convention value instead.
As a temporary fix, @hyperdx/instrumentation-sentry-node could explicitly depend on a compatible, pinned @opentelemetry/sdk-trace-base version.
Description
@hyperdx/node-opentelemetry@0.11.0fails immediately when imported after a clean installation.The failure happens before calling
initSDKand can be reproduced without Next.js, a bundler, or any HyperDX configuration.@hyperdx/node-opentelemetry@0.10.5loads successfully under the same environment.Minimal reproduction
The issue is also reproducible with pnpm:
pnpm add @hyperdx/node-opentelemetry@0.11.0 node -e "require('@hyperdx/node-opentelemetry')"Actual behavior
Expected behavior
The package should load successfully after a clean installation:
Environment
@hyperdx/node-opentelemetry: 0.11.0@opentelemetry/sdk-trace-base: 2.9.0Analysis
@hyperdx/instrumentation-sentry-node@0.2.0imports an internal OpenTelemetry module:@hyperdx/node-opentelemetry@0.11.0declares:A clean installation currently resolves that range to
2.9.0.The internal
build/src/enumsmodule exists insdk-trace-base@2.7.1, but no longer exists in2.9.0, causing the package import to fail.The problem appears to be caused by relying on an internal OpenTelemetry path together with a non-pinned dependency range.
Verified workarounds
Pinning
sdk-trace-baseto2.7.1makes version0.11.0load successfully:Downgrading HyperDX also works:
Suggested fix
Avoid importing from the private
build/src/enumspath and use a public API or semantic-convention value instead.As a temporary fix,
@hyperdx/instrumentation-sentry-nodecould explicitly depend on a compatible, pinned@opentelemetry/sdk-trace-baseversion.