News for hackers. Stuff that matters.
Re:Reimagining front-end web development with htmx and hyper... by wonderbore on Thursday July 07, 2022 @03:09AM (#32010810)
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.

There are no comments on this comment yet.