simple-peer icon indicating copy to clipboard operation
simple-peer copied to clipboard

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

Open idiosyncrasy00 opened this issue 2 years ago • 8 comments

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.

idiosyncrasy00 avatar Apr 12 '22 15:04 idiosyncrasy00

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

Velua avatar Apr 17 '22 21:04 Velua

I am getting the same error

vedantkarle avatar May 06 '22 12:05 vedantkarle

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

ghost avatar May 10 '22 07:05 ghost

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

Bernard-Murphy avatar May 17 '22 10:05 Bernard-Murphy

Same problem using this example with Create React App

AlexMesser avatar May 27 '22 11:05 AlexMesser

getting this too on create-react-app

abhi-dasgupta avatar Sep 27 '22 07:09 abhi-dasgupta

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

StanislavMayorov avatar Sep 19 '23 12:09 StanislavMayorov