Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/aws-serverless
SDK Version
8.0.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
For completeness I thought I would link this here too: open-telemetry/opentelemetry-js#4691
When bundling @sentry/...@^8
in a "full ESM" mode, you will get (potentially) hundreds of errors along the lines of:
WARN ▲ [WARNING] Constructing "ImportInTheMiddle" will crash at run-time because it's an import namespace object, not a constructor [call-import-namespace]
../../node_modules/@prisma/instrumentation/node_modules/@opentelemetry/instrumentation/build/esm/platform/node/instrumentation.js:273:30:
273 │ var esmHook = new ImportInTheMiddle([
╵ ~~~~~~~~~~~~~~~~~
Consider changing "ImportInTheMiddle" to a default import instead:
../../node_modules/@prisma/instrumentation/node_modules/@opentelemetry/instrumentation/build/esm/platform/node/instrumentation.js:55:7:
55 │ import * as ImportInTheMiddle from 'import-in-the-middle';
│ ~~~~~~~~~~~~~~~~~~~~~~
╵ ImportInTheMiddle
I have not taken the time to identify how / when this error could be encountered, but can confirm that doing the following in a module environment will throw an error:
import * as ImportInTheMiddle from 'import-in-the-middle';
var esmHook = new ImportInTheMiddle( ... );
The instantiation would need to look like:
var esmHook = new ImportInTheMiddle.default.default( ... );
Would be nice to add some support for either of the following issues:
- "ImportInTheMiddle" will crash at run-time open-telemetry/opentelemetry-js#4691
- fix: use require for import in the middle open-telemetry/opentelemetry-js#4546
If for no other reason than eliminating unnecessary warnings during build.
Expected Result
NA
Actual Result
NA
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status