We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
global
When using randombytes@2.1.0 in a browser environment with Vite as the build tool, the following error occurs:
randombytes@2.1.0
Uncaught ReferenceError: global is not defined
This error stems from the browser.js implementation attempting to access the global object which is not available in browser DOM environments:
var Buffer = require('safe-buffer').Buffer var crypto = global.crypto || global.msCrypto
As the source code mentioned below crypto is defined correctly
crypto
randombytes/browser.js
Lines 15 to 16 in b4eb412
The text was updated successfully, but these errors were encountered:
crypto-browserify
No branches or pull requests
When using
randombytes@2.1.0
in a browser environment with Vite as the build tool, the following error occurs:This error stems from the browser.js implementation attempting to access the
global
object which is not available in browser DOM environments:As the source code mentioned below
crypto
is defined correctlyrandombytes/browser.js
Lines 15 to 16 in b4eb412
The text was updated successfully, but these errors were encountered: