Closed acidoxee closed 1 year ago
Thanks for reporting this! This sounds like a regression to me. Iām not in office until beginning of next week, but will take a look then.
Released a pure ESM version in https://github.com/blitz-js/superjson/releases/tag/v2.0.0, let me know if that works for you!
I'm currently assessing whether this breaks something or not in my app, but what's sure is that esbuild now properly leverages ESM for superjson
and its dependencies š„³
I believe going ESM-only is the right move for most libs, otherwise people would rarely have any real incentive to move away from CJS. Anyway, thanks a lot for your quick reaction and fix! I'll open another issue if I stumble upon other problems.
The files in
dist/esm
are not valid ESM because:package.json
with{ "type": "module" }
in it, OR files use a.js
extension instead of.mjs
(since the closestpackage.json
states the package is using CJS)This causes esbuild (for my case) and maybe other bundlers to discard this entrypoint and fallback to the CJS one instead (TypeScript resolution also points towards the CJS entrypoint, even when consumed from ESM code).
Do you think you might be able to fix the entrypoint to make ESM code able to consume ESM from your package as well? š