bitcoinjs / tiny-secp256k1

A tiny secp256k1 native/JS wrapper
MIT License
86 stars 55 forks source link

Buffer is not defined error in browser #47

Closed johannesjo closed 4 years ago

johannesjo commented 4 years ago
rfc6979.js:3 Uncaught ReferenceError: Buffer is not defined
    at Object../node_modules/tiny-secp256k1/rfc6979.js (rfc6979.js:3)
    at __webpack_require__ (bootstrap:79)
    at Object../node_modules/tiny-secp256k1/js.js (js.js:4)
    at __webpack_require__ (bootstrap:79)
    at Object../node_modules/bip32/src/bip32.js (bip32.js:5)
    at __webpack_require__ (bootstrap:79)
    at Object../node_modules/bip32/src/index.js (index.js:3)
    at __webpack_require__ (bootstrap:79)
    at Object../node_modules/bitcoinjs-lib/src/index.js (index.js:3)
    at __webpack_require__ (bootstrap:79)

Is this even supposed to work in the browser? :)

junderw commented 4 years ago

This is a problem with your webpack configuration. I have many webpack and browserify projects that use this library without issue in the Browser.