browserify / randombytes

random bytes from browserify stand alone
MIT License
99 stars 47 forks source link

simple-peer on sveltekit (uses Vite behind the scene) #30

Closed pjebs closed 1 year ago

pjebs commented 2 years ago

It seems like this package is creating some issues with sveltekit (uses Vite behind the scene)

global is not defined
ReferenceError: global is not defined
    at node_modules/randombytes/browser.js (http://localhost:3000/node_modules/.vite/simple-peer.js?v=10be15c3:2351:18)
    at __require (http://localhost:3000/node_modules/.vite/chunk-UNANNA3Z.js?v=10be15c3:38:50)
    at node_modules/simple-peer/index.js (http://localhost:3000/node_modules/.vite/simple-peer.js?v=10be15c3:5160:23)
    at __require (http://localhost:3000/node_modules/.vite/chunk-UNANNA3Z.js?v=10be15c3:38:50)
    at http://localhost:3000/node_modules/.vite/simple-peer.js?v=10be15c3:6017:27
ErcouldnT commented 2 years ago

Any solution for this?

Dr-Chaos commented 2 years ago

I use Vite too (with Vuejs) and have the same issue :/

daroOkpeku commented 1 year ago

I am have the same issue on react

pjebs commented 1 year ago

See discussion here: https://github.com/feross/simple-peer/issues/883

dcousens commented 1 year ago

Probably a duplicate of https://github.com/browserify/randombytes/issues/33