-
Notifications
You must be signed in to change notification settings - Fork 812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong import for "import-in-the-middle" with ESM #4717
Comments
This issue is similar to issue #3954 but not the same. |
Reporting this issue as requested in #4553 (comment) |
3 tasks
bengl
pushed a commit
to nodejs/import-in-the-middle
that referenced
this issue
May 31, 2024
`import-in-the-middle` has some ESM interop issues. From [here](open-telemetry/opentelemetry-js#4546 (comment)): > Specifically, namespace imports are required by the ESM spec to be objects. IITM's top-level export is not an object, but a callable function This causes [issues](open-telemetry/opentelemetry-js#4717) with some bundlers. Obviously bundled imports will not go through `import-in-the-middle` but using it should not inhibit bundlers as iitm can still hook build-in modules. This adds a `Hook` named export and changes one cjs and esm test to use that new export.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
Steps to Reproduce
Import from "@opentelemetry/instrumentation" and bundle using esbuild with
format: 'esm'
Expected Result
The build should proceed without warning and not crash during runtime.
Actual Result
When AWS CDK builds with esbuild, the following warning is emitted:
Runtime, the application crashes with
Additional Details
OpenTelemetry Setup Code
No response
package.json
Relevant log output
No response
The text was updated successfully, but these errors were encountered: