BigInt support in TeleJSON #13950
BigInt support in TeleJSON #13950
Comments
|
@shilman want me to add this to |
|
@phated sure! |
|
The referenced telejson merge was shipped in version 5.3.0 and storybook comes with 5.3.3, I'm still experiencing this issue. Most of my components have bigint in them, so I can't use Storybook until this is fixed :/ I don't know anything about storybook dev, but from a quick look this issue stems from the which would need to include something like JSON.stringify(value, (key, value) =>
typeof value === "bigint" ? value.toString() + "n" : value
, 2);which stops everything from crashing I imagine the needs updating to JSON.parse(raw, (key, value) => {
if (typeof value === "string" && /^\d+n$/.test(value)) {
return BigInt(value.substr(0, value.length - 1));
}
return value;
});There are a few unfortunately, the REJT (React Editable JSON tree) doesn't render the +1 to the |


Currently is you set a component property to an object carrying a
BigIntthe entire storybook stops functioning. The console logs show an error trying to serialize this object.Code sample to help you get the context :
Switching to json-bigint which is a drop-in replacement would solve this issue in a blink.
The text was updated successfully, but these errors were encountered: