-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PeerJS not working with React #641
Comments
Yes, it's a very annoying dependency which kills server-side rendering (SSR) like on NextJS. I ended up by moving the PeerJS to the 'store' layers, using redux-saga for my experiment, using eventChannels (https://redux-saga.js.org/docs/advanced/Channels.html). I only start the saga when I'm in client-side scope and I have 'window' available. export default function* rootSaga() {
// NextJS' webpack config injects process.browser if this snippet is running in the browser
if (process.browser) {
yield all([...gameSagas])
}
} Good luck! |
I managed to get around this by importing react component that uses peerjs with @loadable/component. |
I have created this POC for video calling web-app with react. |
Hey :-) long shot I know since it was a long time ago you answered, but I could use some help with running PeerJS in NextJS with Redux Saga. I'm using |
I was excited to get PeerJS working my local developer environment using Gatsby/React. However, when I went to build the website, it didn't work because, come to find out, PeerJs must be trying to access the window.
Does anyone know how to get around this? An alternative that I can try?
Thanks
The text was updated successfully, but these errors were encountered: