bitcoinjs / bitcoinjs-lib

A javascript Bitcoin library for node.js and browsers.
MIT License
5.69k stars 2.11k forks source link

Expected Buffer, got Buffer #847

Closed ddabek closed 7 years ago

ddabek commented 7 years ago

screen shot 2017-08-14 at 7 50 57 pm 1

Trying the OP_RETURN example and getting this error:

message : "Expected Buffer, got Buffer"

var data = Buffer.from('bitcoinjs-lib', 'utf8') var dataScript = bitcoin.script.nullData.output.encode(data)

dcousens commented 7 years ago

Browserified? Web-packed?

This is a tell-tale sign of two types of Buffer existing.

cryptokage1996 commented 4 years ago

I am getting same error while using bip39 can you please tell me how resolved this error. getRoot() { const mnemonic = bip39.generateMnemonic(); const seed = bip39.mnemonicToSeedSync(mnemonic); const root = bip32.fromSeed(seed, bitcoin.networks.testnet) return root; }

But I am getting this error in line where I am trying to get root bip32.fromSeed(seed, bitcoin.networks.testnet)

Error: Expected Buffer, got Buffer

junderw commented 4 years ago

are you using multiple bundles?

one for bip32 and bitcoinjs-lib and one for bip39?