forked from bigearth/bitbox-cli
-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Labels
TypescriptRequires expertise in TypeScriptRequires expertise in TypeScript
Description
Hi
In a new typescript project when using bitbox-sdk by npm i bitbox-sdk:
import { BITBOX } from 'bitbox-sdk'
let bitbox = new BITBOX();
bitbox.Mnemonic.generate()When using tsc to compile the typescript it reports these errors:
C:\Users\rouan\Desktop\work\tempbitbox>tsc test.ts
node_modules/bitbox-sdk/lib/Crypto.ts:1:8 - error TS1259: Module '"C:/Users/rouan/Desktop/work/tempbitbox/node_modules/@types/randombytes/index"' can only be default-imported using the 'esModuleInterop' flag
1 import randomBytes from "randombytes"
~~~~~~~~~~~
node_modules/@types/randombytes/index.d.ts:10:1
10 export = randomBytes;
~~~~~~~~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
node_modules/bitbox-sdk/lib/Mnemonic.ts:5:8 - error TS1259: Module '"C:/Users/rouan/Desktop/work/tempbitbox/node_modules/@types/randombytes/index"' can only be default-imported using the 'esModuleInterop' flag
5 import randomBytes from "randombytes"
~~~~~~~~~~~
node_modules/@types/randombytes/index.d.ts:10:1
10 export = randomBytes;
~~~~~~~~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
Found 2 errors.This leads me to believe that we need to change code in bitbox-sdk or the randombytes module? Anyone that can provide input on this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
TypescriptRequires expertise in TypeScriptRequires expertise in TypeScript