opentelemetry.io icon indicating copy to clipboard operation
opentelemetry.io copied to clipboard

Add clarification for otel-js apps written in CJS and ESM

Open JamieDanielson opened this issue 1 week ago • 3 comments

Node.js has two module systems: CommonJS(CJS) and ECMAScript modules(ESM). As ESM becomes more common in usage, we need to better document the current assumptions and requirements.

This is a start with the bare minimum, which is to specify the assumption that the app is running as CJS... as well as document the loader hook currently required for ESM apps. It seemed useful to start here based on issues like #4812.

  • Refs: https://github.com/open-telemetry/opentelemetry-js/issues/4845
  • Replaces #5072

JamieDanielson avatar Dec 17 '25 21:12 JamieDanielson

I've incorporated the feedback from the original PR, and created new as I wasn't sure what would be easiest to review. Happy to reopen the old if that's better.

JamieDanielson avatar Dec 17 '25 21:12 JamieDanielson

/fix:refcache

theletterf avatar Dec 18 '25 10:12 theletterf

fix:refcache applied successfully in run 20334630470.

otelbot-docs[bot] avatar Dec 18 '25 11:12 otelbot-docs[bot]