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.01k stars 87 forks source link

ReferenceError: Can't find variable: BigInt #65

Closed flybayer closed 3 years ago

flybayer commented 3 years ago

Superjson is totally broken in Safari 13. Currently affecting my client's app :grimacing:

ReferenceError: Can't find variable: BigInt

I guess we need to first check if this (and any other new types like this) are available before trying to use them.

flybayer commented 3 years ago

For a workaround I tried to polyfill with the below but didn't work.

window["BigInt"] = require("big-integer")
Zeko369 commented 3 years ago

Did using patch-package to add polyfill here work?

Skn0tt commented 3 years ago

I'll add a check for it.