flightcontrolhq / superjson

Safely serialize JavaScript expressions to a superset of JSON, which includes Dates, BigInts, and more.
https://www.flightcontrol.dev?ref=superjson
MIT License
4.02k stars 87 forks source link

superjson.registerCustom is not defined when "type": "module" (regression) #214

Closed mgreystone closed 1 year ago

mgreystone commented 1 year ago

It appears https://github.com/blitz-js/superjson/issues/186 has been re-introduced in v1.11.0.

If i have "type": "module" set in package.json, then superjson.registerCustom does not exist. superjson.default.registerCustom exists, but typescript cannot find it.

v1.10.1 works as expected.

Skn0tt commented 1 year ago

Should be fixed in https://github.com/blitz-js/superjson/releases/tag/v1.12.1. Thank you for reporting!

@all-contributors please add @mgreystone for bug

allcontributors[bot] commented 1 year ago

@Skn0tt

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

I've put up a pull request to add @mgreystone! :tada:

mgreystone commented 1 year ago

Confirmed fixed on my end. Thank you so much.