json-bigint
json-bigint copied to clipboard
BUG,BigNumber is not a constructor
environment :vue3+vite+element-plus when used 🔢:
import JSONbig from 'json-bigint'
let json = '{ "value" : 9223372036854775807, "v2": 123 }'
let r1 = JSONbig.parse(json)
console.log('JSONbig.parse(input).value : ', r1.value.toString())
ERROR! like this:
TypeError: BigNumber is not a constructor
Used in typescript backend, bundled with webpack:
import { parse as JSONBigIntParse } from 'json-bigint'; // import * as JSONBitInt from 'json-bigint' fails too
const parsedRespons: ReqResp = JSONBigIntParse(data as unknown as string);
Results in:
TypeError: r is not a constructor
same here.
I'm getting an error, TypeError: Right-hand side of 'instanceof' is not callable
here
I think this is the same problem as in this issue
My app is bundled with rollup
Maybe later I will try a minimal reproduction
I think those issues all related with #34