Open
Description
When using randombytes@2.1.0
in a browser environment with Vite as the build tool, the following error occurs:
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
Lines 15 to 16 in b4eb412
Metadata
Metadata
Assignees
Labels
No labels