Closed
Description
Currently we use an older version of import-in-the-middle
that does not work with
- Node.js v18.19
- Node.js v20
- Node.js v21
We're blocked on updating to [email protected]
in the core repo as that version includes a bug (nodejs/import-in-the-middle#57) which breaks our way of detecting ESM packages. We do this ESM detection in multiple packages.
To resolve this issue there are two options:
- Option 1 (preferred): contribute a fix for
@@toStringTag
property not present on modules passed tohookFn
nodejs/import-in-the-middle#57 upstream- contribute a fix (thanks @trentm 🎉 - fix: ensure the hooked module exports has @@toStringTag property nodejs/import-in-the-middle#66)
- wait for the release of import-in-the-middle
Option 2: implement an ESM detection workaround in this repo, which does not rely on(we're going for option 1)@@toStringTag
in-
@opentelemetry/instrumentation-koa
-
@opentelemetry/instrumentation-ioredis
-
@opentelemetry/instrumentation-bunyan
-
@opentelemetry/instrumentation-pg
- this is currently missing tests for ESM, so implementing a workaround would require implementing tests for it first, coordinate first pass at ESM support for all instrumentations #1942
-
@opentelemetry/instrumentation-pino
- this is currently missing tests for ESM, so implementing a workaround would require implementing tests for it first, coordinate first pass at ESM support for all instrumentations #1942
-
Regardless of the option chosen above, we then need to:
- bump the
import-in-the-middle
version in core, removeimport-in-the-middle
form the ignore list inrenovate.json
- wait for a core release (done by a maintainer)
- update core packages
and release a new contrib version(done by a maintainer)- no new version needed as this was just a patch release
- enable testing of previously unsupported Node.js in the workflows of this repo