Cannot read property 'call' of undefined
See original GitHub issueI get this error when using the lib in the browser:
Uncaught (in promise) TypeError: Cannot read property 'call' of undefined
at new hd (vendor.57ab6ea3.js:19)
at new vh (vendor.57ab6ea3.js:22)
at index.c008e8f0.js:1
hd @ vendor.57ab6ea3.js:19
vh @ vendor.57ab6ea3.js:22
(anonymous) @ index.c008e8f0.js:1
Promise.then (async)
sendMic @ index.c008e8f0.js:1
wt @ vendor.57ab6ea3.js:1
Et @ vendor.57ab6ea3.js:1
n @ vendor.57ab6ea3.js:1
the stack trace is obfuscated but the line it points to seems to be in the readable-stream
module. (i think its this one? https://github.com/nodejs/readable-stream/blob/master/lib/_stream_duplex.js#L60)
Code:
navigator.mediaDevices.getUserMedia({
audio: true,
video: false
}).then((stream) => {
createPeer(this.socket as Socket);
peer.addStream(stream);
});
}
function createPeer(socket: Socket) {
if (!peer) {
peer = new Peer({
initiator: true
});
socket.on('peer-signal', (data) => {
peer.signal(data);
});
peer.on('signal', data => {
socket.emit('peer-signal', data)
});
}
return peer;
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:9
Top Results From Across the Web
Uncaught TypeError: Cannot read property 'call' of undefined ...
One of the solution was to use concatenateModules: false apparently, but to no avail, it didn't solve my issue. So I tried with...
Read more >Uncaught TypeError: Cannot read property 'call' of undefined
I'm having an issue with webpack where if I stop watching and restart, it will build just fine, but if I edit a...
Read more >Uncaught TypeError: Cannot read property 'call' of ... - Laracasts
You need to show us your code that is causing the error. It's pointing to my vue component, I excluded it from app....
Read more >Cannot read property 'call' of undefined" error occurs when an ...
HtmlEditor - The " __webpack_require__ => Uncaught TypeError: Cannot read property 'call' of undefined" error occurs when an application with ...
Read more >error in console TypeError: Cannot read property 'call' of ...
TypeError : Cannot read property 'call' of undefined - the code is. the file linked to the message is a theme bundle file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Working for me now using:
npm install -D vite-compatible-readable-stream
Thanks @m00nwtchr for:
npm install -D events
Fake process for the browser:
npm install -D process global
Then add this before you use SimplePeer:Add this to your vite.config.ts:
Think that’s most of what I did, good luck!
Nvm, looks like i just had to install the
events
package