I am deploying a react app that uses some Solana packages and the app is breaking with the following type error:
Uncaught TypeError: Cannot convert a BigInt value to a number
at Math.pow (<anonymous>)
at 8953 (main.78866a30.js:2:547022)
at __webpack_require__ (main.78866a30.js:2:1792446)
at main.78866a30.js:2:2149776
at main.78866a30.js:2:2514541
at main.78866a30.js:2:2514545
I spent a little bit of time looking at the compiled javascript and found some instances of Math.pow that could cause this error, like here for example:
C = BigInt(Math.pow(2, 32) - 1),
P = BigInt(32);
function T(e) {
var t =
arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
return t
? { h: Number(e & C), l: Number((e >> P) & C) }
: { h: 0 | Number((e >> P) & C), l: 0 | Number(e & C) };
}
I'm assuming it's a Solana package because the surrounding code is hashing and digest functions. Is there any way to figure out which package this code is coming from? Or any other quick fixes?