Skip to content
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

fix: use require for import in the middle #4546

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dyladan
Copy link
Member

@dyladan dyladan commented Mar 14, 2024

Fixes an issue where bundlers (esbuild) fail to build because of es module interop issues.

Import in the middle does not have a default export, which means import IITM from 'import-in-the-middle'; fails. Importing as a namespace with import * as IITM from 'import-in-the-middle'; works, but causes issues with bundlers. 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 (https://github.com/DataDog/import-in-the-middle/blob/c3c2c52c1915b47994af59d507c59029c1f1fae9/index.js#L91).

This draft is to consider the possibility of using require instead of import for this dependency.

Related to #4519

Fixes an issue where bundlers (esbuild) fail to build because of es
module interop issues
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Merging #4546 (6ffda27) into main (3a426e8) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4546   +/-   ##
=======================================
  Coverage   92.83%   92.83%           
=======================================
  Files         328      328           
  Lines        9486     9486           
  Branches     2035     2035           
=======================================
  Hits         8806     8806           
  Misses        680      680           

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant