Closed juliusmarminge closed 1 year ago
Not optimal since it doesn't fix the default import, but works as a workaround 🤷🏼♂️
Tested using yalc
locally and linking to a separate package outside the superjson repo
That's a good workaround, I guess. The problem with the default export boils down to the fact that apparently, SuperJSON
in this context is of type Module
, not the class that we expect it to be. So this should also work:
import SuperJSON from "superjson"
new SuperJSON.default()
Let's get this merged 🤷
So this should also work:
import SuperJSON from "superjson" new SuperJSON.default()
While that might work in runtime, you get typeerrors. Somewhere the type is wrong I guess? Bundlers are weird...
Published as part of https://github.com/blitz-js/superjson/releases/tag/v1.13.1.
And this errors with the same error:
import * as SuperJSON from 'superjson'
export const superjson = new SuperJSON.default({
dedupe: true,
})
Published as part of https://github.com/blitz-js/superjson/releases/tag/v1.13.1.
Can confirm it works straight from node_modules (no local linked package) 👍🏼
"Fixes" https://github.com/blitz-js/superjson/pull/247#issuecomment-1637631294
now works. default import still broken though