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 require on safe-buffer dependency to fix Buffer undefined error when ran in a browser. #21

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

frelibert
Copy link

This change makes browserify-rsa run in a browser, clientside, which is mainly the purpose of having a browserify module.
browserify-rsa depends on Buffer, which is part of Node js API, only available serverside and therefore not available when running in the browser.
This can be fixed by adding 'safe-buffer' as dependency and following require statement.

var Buffer = require('safe-buffer').Buffer

This was added to the index.js script, in the same way as allready set in browserify-aes and others.

.gitignore Outdated Show resolved Hide resolved
@ljharb ljharb merged commit 28d2560 into browserify:master Sep 26, 2024
331 checks passed
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.

2 participants