sidorares / json-bigint

JSON.parse/stringify with bigints support
MIT License
790 stars 189 forks source link

BUG,BigNumber is not a constructor #52

Open lostimever opened 3 years ago

lostimever commented 3 years ago

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
WandersonAlves commented 3 years ago

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

ZQ-jhon commented 2 years ago

same here.

perrin4869 commented 2 years ago

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

yzx9 commented 2 years ago

I think those issues all related with #34