You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f {message: "Expected property "0" of type ECPair, got g", __label: undefined, __property: 0, __value: g, __type: ƒ, …}
message: "Expected property "0" of type ECPair, got g"
__label: undefined
__property: 0
__type: ƒ t(t)
__value: g {d: n, compressed: true, network: {…}}
__valueTypeName: "g"
stack: "Error: Expected property "0" of type ECPair, got g↵ at a (http://localhost:63342/BlockchainAPI/blockchain-api.min.js:60:76182)↵ at tfSubError (http://localhost:63342/BlockchainAPI/blockchain-api.min.js:60:77360)↵ at http://localhost:63342/BlockchainAPI/blockchain-api.min.js:24:73605↵ at Array.every (<anonymous>)↵ at t (http://localhost:63342/BlockchainAPI/blockchain-api.min.js:24:73547)↵ at d (http://localhost:63342/BlockchainAPI/blockchain-api.min.js:24:74101)↵ at new p (http://localhost:63342/BlockchainAPI/blockchain-api.min.js:72:5919)↵ at Function.p.fromSeedBuffer (http://localhost:63342/BlockchainAPI/blockchain-api.min.js:72:6536)↵ at t.e.fromSeed (http://localhost:63342/BlockchainAPI/blockchain-api.min.js:52:66628)↵ at Object.<anonymous> (http://localhost:63342/BlockchainAPI/blockchain-api.min.js:60:275738)"
__proto__: Error
Possibly this error should be forwarded to bitcoinjs-lib.
I also remember this worked with SLP-SDK v1.x about 1 year ago, but now even going back to 1.3.2 still results in the same error. So some breaking changes in WebPack (??) could also be the cause.
The text was updated successfully, but these errors were encountered:
I have tracked the issue down to the JS minifaction done by Webpack.
Specifically by changing mode: "development", in webpack.config.js the code works in the browser without changes.
I also tried switching from Terser minification (WebPack's default) to ClosureCompiler. Still gives exactly the same error.
By simply creating breakpoints in hdnode.js in HDNode.fromSeedBuffer there is no visible difference in local variables and function parameters between the working and not working (minified) code.
So I assume minify removes some code which is needed for this. Even when explicitly disabling WebPacks Tree shaking with "sideEffects": true, in package.json (which should only be understood by Terser minify either way) the error persists.
The problem also continues after updating to latest WebPack 4.41.2. But it's not urgent anymore, as for now my workaround is just to compile slp-sdkseperately (not minified) and expose it on the global window object for the main project to use.
Tested in
Chrome 78
I have uploaded a small sample project to reproduce this error: https://github.com/Ekliptor/BlockchainAPI
I can run the example from here with NodeJS v12 and create a wallet https://github.com/Bitcoin-com/slp-sdk/blob/master/examples/create-wallet/create-wallet.js
However, when I try to run it in the browser I get an error in hdnode.js:
Stack
Possibly this error should be forwarded to
bitcoinjs-lib
.I also remember this worked with SLP-SDK v1.x about 1 year ago, but now even going back to
1.3.2
still results in the same error. So some breaking changes in WebPack (??) could also be the cause.The text was updated successfully, but these errors were encountered: