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.

Uncaught ReferenceError: `Buffer` is not defined

See original GitHub issue

I am receiving this error: Capture

I am importing the package like this: import { parseBlob } from "music-metadata-browser"

I am calling the function like this: const metadata = await parseBlob(audio)

I have already checked that I am passing a object of type File using instanceof.

I am using the latest version of music-metadata and Chrome.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Borewitcommented, Mar 13, 2021

I was wondering whether this library could instead operate on Uint8Arrays instead of buffers?

That’s a good question, I have been been working on that behind the screens. One of the issues is that the TextEncoder is limited to utf-8 encoding and decoding in the Node.js implementation.

Related to:

1reaction
olyopcommented, Jan 11, 2021

Thank you, I managed to find a solution. For anyone else looking, It’s an issue with webpack 5.

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 ...
I pick a working project from a friend and set mine to have the same settings. What I could say for sure is...
Read more >
ReferenceError: Buffer is not defined - Homey Community Forum
I am running Homey 7.4.1 and HomeyScript v3.3.0. Restarted HomeyScript and also have restarted Homey. No change. No other installs etc done.
Read more >
How to polyfill Buffer with Webpack 5 | viglucci.io
The “buffer is not defined” error is a common error that can occur when trying to use the Buffer Node.js API in an...
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