Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the buffer polyfill as a dependency #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Vinnl
Copy link

@Vinnl Vinnl commented Jul 5, 2021

In browser-based environments, require("buffer") will fail unless
buffer is available as a dependency and can be provided by a
bundler. This used to automatically be the case in e.g. older
versions of Webpack, but since Webpack v5 no longer automatically
includes polyfills for Node built-ins, it can happen that the
buffer polyfill is no longer available in a project's dependency
tree.

Fixes #18 and nodejs/readable-stream#448.

In browser-based environments, require("buffer") will fail unless
`buffer` is available as a dependency and can be provided by a
bundler. This used to automatically be the case in e.g. older
versions of Webpack, but since Webpack v5 no longer automatically
includes polyfills for Node built-ins, it can happen that the
`buffer` polyfill is no longer available in a project's dependency
tree.
@jimmywarting
Copy link

safe buffer is only needed for node < v6
you should be using Buffer directly instead. or better yet, use Uint8Array instead. it's better for cross compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to resolve module buffer
2 participants