question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Buffer is not defined

See original GitHub issue

use bip32@^2.0.6, Compile error

Uncaught ReferenceError: Buffer is not defined
    at Object../node_modules/tiny-secp256k1/rfc6979.js (rfc6979.js:3:1)
    at Object.options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at Object../node_modules/tiny-secp256k1/js.js (js.js:4:1)
    at Object.options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at Object../node_modules/bip32/src/bip32.js (bip32.js:5:1)
    at Object.options.factory (react refresh:6:1)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
junderwcommented, Jul 21, 2022

Buffer is not a browser API and must be bundled and available for use.

Lately, certain bundlers have stopped automatically including Buffer when bundling, so you will need to manually add Buffer using whatever methods provided by your bundler.

0reactions
emidev98commented, Jul 21, 2022

Exactly, leaving this resource here in case someone has the same problem and needs a solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught ReferenceError: Buffer is not defined - Stack Overflow
Answering my own question. Two things helped to resolve the issue: Adding plugins section with ProviderPlugin into webpack.config.js.
Read more >
Uncaught ReferenceError: Buffer is not defined #1626 - GitHub
Trying to bundle a project which includes https://solana-labs.github.io/wallet-adapter. First, I had a problem with global not being defined ...
Read more >
Buffer is not defined. Using Phantom Wallet, Solana and ...
This is happening because the default bundler that comes with create react app(webpack 5) does not polyfill Buffer .
Read more >
ReferenceError: Buffer is not defined - Homey Community Forum
Buffer is a global variable set by homeyscript. Now it is not defined anymore. Why do you need the script? If you think...
Read more >
React Uncaught ReferenceError: Buffer is not defined
It won't help in case of external library dependency but might save you from reverting other libraries in case of using Buffer in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found