3 ms·
We’re saying the same thing: > Lots of packages in npm are broken in either CJS or ESM mode. And there's no way to tell without trying them. I blame npm for a
by wonderbore 4y ago
We’re saying the same thing:
> Lots of packages in npm are broken in either CJS or ESM mode. And there's no way to tell without trying them.
I blame npm for allowing that to happen. I get that it’s technically a third party, but they never even checked that the file mentioned in `main` was included, even without a “postinstall” step.
They, together with node, could have built a tool that validates main/type/exports on publish, but no. There’s literally no way to validate ESM until you run them or use a full linter. The whole point of ESM was that it’s statically analyzable.