Skip to content
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

ability to require peerjs inside the node repl #677

Open
natesire opened this issue May 28, 2020 · 2 comments
Open

ability to require peerjs inside the node repl #677

natesire opened this issue May 28, 2020 · 2 comments
Labels
client related to peerjs client

Comments

@natesire
Copy link

I am able to load npm modules inside my node repl. But when I try to load peerjs I receive a window error. This might not be a bug. Maybe just an idea. This way, we can make it easy to try ideas out and play with the code. What do you think? Does peerjs need to rely on the window object to work. If so, should I try using the npm window to do it?

var pj=require('peerjs');
Uncaught ReferenceError: window is not defined
at Object.parcelRequire.tI1X../adapter_factory.js (/home/colombia/WebstormProjects/chat-room/node_modules/peerjs/dist/peerjs.min.js:38:161)
at f (/home/colombia/WebstormProjects/chat-room/node_modules/peerjs/dist/peerjs.min.js:1:468)
at p (/home/colombia/WebstormProjects/chat-room/node_modules/peerjs/dist/peerjs.min.js:1:544)
at Object.parcelRequire.sXtV.webrtc-adapter (/home/colombia/WebstormProjects/chat-room/node_modules/peerjs/dist/peerjs.min.js:40:161)
at f (/home/colombia/WebstormProjects/chat-room/node_modules/peerjs/dist/peerjs.min.js:1:468)
at p (/home/colombia/WebstormProjects/chat-room/node_modules/peerjs/dist/peerjs.min.js:1:544)
at Object.parcelRequire.I31f../adapter (/home/colombia/WebstormProjects/chat-room/node_modules/peerjs/dist/peerjs.min.js:42:75)
at f (/home/colombia/WebstormProjects/chat-room/node_modules/peerjs/dist/peerjs.min.js:1:468)
at p (/home/colombia/WebstormProjects/chat-room/node_modules/peerjs/dist/peerjs.min.js:1:544)
at Object.parcelRequire.BHXf.peerjs-js-binarypack (/home/colombia/WebstormProjects/chat-room/node_modules/peerjs/dist/peerjs.min.js:44:285)

@natesire
Copy link
Author

natesire commented Nov 21, 2020 via email

@StoneCypher
Copy link

peerjs is attempting to reference the browser's window global. node does not have one of these.

This means that until the library is taught to not need that, it won't actually work in node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client related to peerjs client
Projects
None yet
Development

No branches or pull requests

3 participants