Missing dual build for CJS and ESM

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Do
    • Priority: Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • Not Needed
    • None
    • Developer Tools

      Problem Statement/Rationale

      In the bundle of mongodb-query-parser, tsc (target CJS) adds Object.defineProperty and then gen-esm-wrapper adds the ESM wrapper.
      Object.defineProperty can be used only for CJS and not for ESM.
      This issue will also occur with other package of devtools-shared.

      Solutions

      Alternatives:

      • Dual build: 1 for CJS and 1 for ESM
      • Single build as ESM

      Expected Results

      No issue with import of mongodb-query-parser.

      Actual Results

      With mongodb-query-parser with ESM, I get toJSString is not a function.

      Additional Notes

      Related:

            Assignee:
            Unassigned
            Reporter:
            Raffaele Tritto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: