Open devalbo opened 4 years ago
I need to look into it, but I'm wondering if this issue is related to the Issue filed for slp-sdk: https://github.com/Bitcoin-com/slp-sdk/issues/76#issuecomment-554716566
This looks very similar to what I've been seeing. I'll post a sample project with the fixes that seem to be working for my particular use case.
@christroutner - Example project here: https://github.com/devalbo/bbtest
I have created a React app using the standard React
create-react-app
(CRA) and then npm installed Bitbox. I can develop my BCH app with no issues in development mode. I can also use the CRA build command to create a production build.However, when my code calls the
sign
method of theTransactionBuilder
class in the production build, an exception with the message"Expected property "0" of type BigInteger, got n"
gets thrown. I've narrowed it down to the use of the typeforce library in thebitcoincashjs-lib
filesecdsa.js
andecsignature.js
. If I comment out the typeforce lines in those files, my transaction is signed as expected.I really don't like the idea of ejecting from the CRA configuration just to fix this, especially since I'd like to release my code as a library and I don't want other web devs to not be able to use minification in their build chains.
I'm wondering if this is a known issue, if there are any plans to fix it, or if there are any workarounds that do not require ejecting.