Closed pajasevi closed 2 years ago
Found out this can be somewhat "fixed" when I use the module as
const bip32 = BIP32Factory.default(ecc)
Which seems to me like there is something wrong when I'm actually using the ES modules.
bip32 doesn't support esm yet.
the import example is for Typescript.
Yeah but the weird thing is that I haven't experienced such issue with any other library. Which kinda tells me there might be something wrong with the TS export transpilation to JS.
esModuleInterop maybe?
can you try:
Tell me if the issue resolves.
That didn't actually help. I also tried messing with reexporting in ts-src/index.ts
but with no luck. Always leads to the same compiled code.
Getting the same error:
This expression is not callable.
Type 'typeof import("/Users/x/Documents/x/code/x/x/node_modules/bip32/types/index")' has no call signatures.ts(2349)
Found out this is an issue in Typescript code as well because the generated types are different than generated code.
Only way to fix this was using ts-ignore
Fixed in 3.0.1
I also have a PR for tiny-secp256k1 that Allows commonJS usage (require)
If you have time, please take a look.
I am using a documented moethod of using this library, yet Node.js throws an error when I try to use the BIP32Factory.
results in error:
My project is running Node.js v14.17.5 and is configured to use ES modules. Same error happened when I tried importing
tiny-secp256k1
asynchronously.I've also tried importing the module directly as
import BIP32Factory from 'bip32/src/bip32.js'
but it resulted in the same error.I' ve looked into the source files (in node_modules) and haven't found what could be wrong.