project-serum / sol-wallet-adapter

Other
185 stars 93 forks source link

Cannot import correctly under TypeScript Node 16 module resolution #53

Open Jack-Works opened 1 year ago

Jack-Works commented 1 year ago

Under TypeScript Node 16 module resolution (has type: module in the package.json and moduleResolution: Node16 in tsconfig.json), this package cannot be imported correctly.

image

import Wallet from '@project-serum/sol-wallet-adapter'
new Wallet()
// type error!
new Wallet.default(provider, 'network')
// runtime error!