Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in sub-dependency prevents bundling projects relying on square-nodejs-sdk #46

Open
tia-gbenson opened this issue Jul 9, 2021 · 2 comments
Labels
BigInt Conflicts arising from 64 bit ints

Comments

@tia-gbenson
Copy link

This problem expresses itself in the form of the following runtime error on projects that have been bundled with webpack (as is often useful for reducing package sizes when running a square-dependent project inside an AWS Lambda function):

TypeError: Right-hand side of 'instanceof' is not callable
    at str (***:/node_modules/json-bigint/lib/stringify.js:218:1)
    at Function.module.exports.JSON.stringify (***:/node_modules/json-bigint/lib/stringify.js:380:1)
(...rest of stack trace here...)

The cause for this is this bug in json-bigint, which has been open for over a year. In turn, the root cause of json-bigint's woes is the same root cause as this two-year-old bug, which bignumber.js has indicated an unwillingness to correct.

A workaround is described here, but this often requires that npm's unsafe-perm option be turned on, which is clearly sub-optimal.

If I thought there was any chance that either json-bigint or bignumber.js would correct this, I wouldn't bring it up in this forum. However, since this problem has a very real impact on usage of this library, my hope is that it can be addressed here.

@onxb
Copy link

onxb commented Jul 26, 2021

Very well written.
For what it's worth, I am experiencing the exact same difficulty.

@diego1686
Copy link

I'm facing the same error. Any workaround about this?

@zenmasterjobo zenmasterjobo added the BigInt Conflicts arising from 64 bit ints label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BigInt Conflicts arising from 64 bit ints
Projects
None yet
Development

No branches or pull requests

4 participants