Transpiler configuration error for BigInts

Hi, my React App (test-transactor.netlify.app) builds locally but throws an error when it runs during deployment:

Uncaught TypeError: Cannot convert a BigInt value to a number
    at Math.pow (<anonymous>)
    at Object.53845 (index.js:14:16)
    at __webpack_require__ (bootstrap:19:32)
    at Object.71734 (v4.ts:1:1)
    at __webpack_require__ (bootstrap:19:32)
    at Object.58420 (index.ts:1:1)
    at __webpack_require__ (bootstrap:19:32)
    at Object.22872 (dns.ts:3:1)
    at __webpack_require__ (bootstrap:19:32)
    at Object.55007 (bootstrap.ts:4:1)
53845 @ index.js:14
__webpack_require__ @ bootstrap:19
71734 @ v4.ts:1
__webpack_require__ @ bootstrap:19
58420 @ index.ts:1
__webpack_require__ @ bootstrap:19
22872 @ dns.ts:3
__webpack_require__ @ bootstrap:19
55007 @ bootstrap.ts:4
__webpack_require__ @ bootstrap:19
93656 @ index.ts:5
__webpack_require__ @ bootstrap:19
12738 @ index.ts:1
__webpack_require__ @ bootstrap:19
(anonymous) @ lightBlue.js:15
(anonymous) @ index.tsx:19
(anonymous) @ index.tsx:19

The error looks very similar to: Uncaught TypeError: Cannot convert a BigInt value to a number · Issue #23 · paulmillr/noble-ed25519 (github.com).

Did you try the solution mentioned in the thread you linked?

I would like to try it but I’m not sure where the transpiler settings are in Netlify. And I also don’t know what settings need to be changed to fix it. I tried adding this section to my package.json but the error is still there.

Is there a chance you should share a repo with Hrishikesh-K on GitHub?

yep the repo should be public here. There are branches called working and broken on consecutive commits to make it easier to see which commit introduced the error.

What’s weird is, I deployed your broken branch: Netlify App

It seems to work fine.

I’m not sure why but your deployed app still gives me the same error on my machine (chrome, firefox and edge) and phone too. The page isn’t supposed to be blank. It will build and deploy (supposedly) okay but running the app locally is different from the deploy. Could you please check the dev console and see if that error is present in your deploy?

Oh, based on your title, this appeared to me like a build issue. Your issue is actually during runtime. Yeah, I’m getting the same error in the console, but this doesn’t seem to be a Netlify issue.

I ran your build locally (npm run build) and started a server to see the built files and I am still getting the same error.

Sorry for the confusion, I mistook it for a build issue. Though I am confused as to why npm start runs as I expected but the npm run build version does not. Would you happen to have any ideas as to what’s happening?

From what I could see, this is probably an issue with your dependencies, at least one of them, because I can’t find any such reference to a BigInt in your code. You need to figure out which one it is, and file an issue for them.

Thanks, I think it might be the js-waku package so I’ll message them about it.

1 Like