-
Type:
Bug
-
Resolution: Won't Do
-
Priority:
Major - P3
-
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: