You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
simple-peer.js?v=eb7dd428:571 Uncaught (in promise) Error: Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11 at oldBrowser (simple-peer.js?v=eb7dd428:571:13) at new _Peer (simple-peer.js?v=eb7dd428:5966:20) at prepareNewPeerConnection (webRTCHandler.js:59:29) at Socket2.<anonymous> (socketConnection.js:58:5) at Emitter.emit (socket__io-client.js?v=77d8b3f1:427:21) at Socket2.emitEvent (socket__io-client.js?v=77d8b3f1:2731:16) at Socket2.onevent (socket__io-client.js?v=77d8b3f1:2719:12) at Socket2.onpacket (socket__io-client.js?v=77d8b3f1:2690:14) at Emitter.emit (socket__io-client.js?v=77d8b3f1:427:21) at socket__io-client.js?v=77d8b3f1:3287:12 i m getting this error while using react vite please can anybody solve this error i m stuck
#932
Open
amaann2 opened this issue
Mar 24, 2024
· 5 comments
it worked for me using this import import Peer from 'simple-peer/simplepeer.min.js'
instead of this import Peer from 'simple-peer';
and without using global in defineConfig in vite
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
});
found the solution to this, just in your vite.config.ts or vite.cofig.js comment out global: {}, worked for me, your vite.config.ts file should look like this
I am using node-bignumber to calculate an RSA encrypt value, I have to require it instead of import it, that is the viteCommonjs. Then I have to polyfill crypto and buffer for it, that is the polyfills.
Then commenting out global fixed the issue with randomNumber missing for me for some reason. So thanks!
What version of this package are you using?
What operating system, Node.js, and npm version?
What happened?
What did you expect to happen?
Are you willing to submit a pull request to fix this bug?
The text was updated successfully, but these errors were encountered: