json-bigint icon indicating copy to clipboard operation
json-bigint copied to clipboard

BUG,BigNumber is not a constructor

Open lostimever opened this issue 3 years ago • 4 comments

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

lostimever avatar Apr 07 '21 09:04 lostimever

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

WandersonAlves avatar May 26 '21 15:05 WandersonAlves

same here.

ZQ-jhon avatar Jul 09 '21 12:07 ZQ-jhon

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

perrin4869 avatar Jan 20 '22 05:01 perrin4869

I think those issues all related with #34

yzx9 avatar Feb 23 '22 05:02 yzx9