I've spent a significant number of hours bashing my head against the same issue and reading tons of GitHub issue threads
It seems to come down to the es module spec being half baked so that it's not possible to implement them in a backward compatible way with the rest of the nodejs ecosystem
I'm not sure what the solution is, but I no longer use any packages which export only an es module.
Can you explain more what is half-baked about ES6 modules? To me the logic and syntax of how imports [1] and exports [2] are organized seems clean, but maybe I'm missing something?
Sure the interoperability between things that do and do not (pure ES6) require a build/bundle/whatever, and between JavaScript and TypeScript may remain an engineering challenge, but that's not for the ES6 modules spec to solve, right?
I agree, if we had all started with it, it is nice. But it completely breaks backwards compatibility with the whole existing node.js ecosystem, costing countless developer hours. Backwards compatibility is a serious concern.
It seems very likely to me a solution could have been found that would allow node to support the combination of esm and cjs.
It seems to come down to the es module spec being half baked so that it's not possible to implement them in a backward compatible way with the rest of the nodejs ecosystem
I'm not sure what the solution is, but I no longer use any packages which export only an es module.