feross / simple-peer

📡 Simple WebRTC video, voice, and data channels
MIT License
7.46k stars 978 forks source link

Process not defined when triggering peer.on("connect") and peer.on("data") in reactjs #885

Open idiosyncrasy00 opened 2 years ago

idiosyncrasy00 commented 2 years ago

Hello. I am having issues when implementing simple-peer in reactjs, which is whenever another person joins the room, it cannot trigger these two functions of simple-peer. However my implementation works fine in a non-framework web (using plain javascript and html). The almost similar issue can be found here: https://stackoverflow.com/questions/70899364/simple-peer-on-data-stream-throws-process-not-defined-error Thank you for reading.

Velua commented 2 years ago

Make sure you're using vanilla React as I was using Vite before and it wouldn't work.

vedantkarle commented 2 years ago

I am getting the same error

ghost commented 2 years ago

I'm having a similar issue with simple-peer and reacjs, also the console throw a readable stream error when using peer.on("data")

Bernard-Murphy commented 2 years ago

I have the same problem. Was able to fix it by using the simplepeer.min.js file instead of the node module.

AlexMesser commented 2 years ago

Same problem using this example with Create React App

abhi-dasgupta commented 2 years ago

getting this too on create-react-app

StanislavMayorov commented 1 year ago

It helped me to fix an issue with create-react-app. It's important to init before simple-peer https://stackoverflow.com/a/77078047/5700121

puopg commented 6 months ago

This should be the answer: https://github.com/feross/simple-peer/issues/767