Closed KATT closed 1 year ago
You decide everything and me / @juliusmarminge will just follow suit. :)
Feel free to just push to my PR or make another stab at it, I gotta go for today now!
FWIW, changing the circular to anything else but null
could be seen as a breaking change - so maybe it's better to have both as null
for now
Published as part of https://github.com/blitz-js/superjson/releases/tag/v1.13.0
Published as part of https://github.com/blitz-js/superjson/releases/tag/v1.13.0
Awesome. Unfortunately, for some reason I get an error when running the compiled version yelling that SuperJSON isn't a constructor 🤔
Can reproduce locally, let's see what's causing it 🤔
It looks like it's related to how TypeScript emits the export default class
. Seems like that bug has existed before this PR, but nobody tried doing new SuperJSON
until now!
It looks like it's related to how TypeScript emits the export default class
Bundling javascript....
Seems like that bug has existed before this PR, but nobody tried doing new SuperJSON until now!
Seems reasonable. Nothing in this PR should cause difference in behavior in that regard
As a workaround, could you try const SuperJSON = require(".").default
? That fixed it for me locally.
As a workaround, could you try const SuperJSON = require(".").default? That fixed it for me locally.
How do you mean? The relative require('.')
won't work outside of the local repo. I tried this without success though:
import type SuperJSON from 'superjson'
// eslint-disable-next-line @typescript-eslint/no-var-requires, unicorn/prefer-module
export const superjson: SuperJSON = require('superjson').default({
dedupe: true,
})
Oops, meant to replace the .
with superjson
. But you guessed right, that's what I was referring to - doesn't seem to work, though. I'll see what I can do to fix the import
...
Oops, meant to replace the . with superjson. But you guessed right, that's what I was referring to - doesn't seem to work, though. I'll see what I can do to fix the import ...
Made a temporary workaround that works if you use a named import instead of the default one in #250 🤷🏼♂️
add dedupe flag that will make sure that complex objects only appear once in the output