-
Notifications
You must be signed in to change notification settings - Fork 790
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
"ImportInTheMiddle" will crash at run-time #4691
Comments
@davidmurdoch are you also seeing these warnings? |
FYI - For ESM this is absolutely a problem. Using the import syntax as is, the code would need to look like: import * as ImportInTheMiddle from 'import-in-the-middle';
var esmHook = new ImportInTheMiddle.default.default( ... ); |
Hey, we also have ran into this problem. I went down a rabbit hole of fixing this across the codebase #4519 But I didn't account for this being a breaking change for some configs. @dyladan had a proposal that would fix this without the breaking change #4546 I currently don't have the time to do any work on this |
What happened?
Warning output from
esbuild
bundler.From the code, I would have to agree with the warning that this will crash if used.
I don't understand how you could import like this:It is not valid to import like this:
opentelemetry-js/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts
Line 28 in ca027b5
And then instantiate like this:
opentelemetry-js/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts
Lines 308 to 313 in ca027b5
It will absolutely throw an exception.
For ESM, the instantiation would need to look like:
But there are lots of things I do not know, so would be interested to hear if this would actually work!The text was updated successfully, but these errors were encountered: