electron-webrtc icon indicating copy to clipboard operation
electron-webrtc copied to clipboard

RTCPeerConnection.createOffer only implements the old non-Promise API

Open BkPHcgQL3V opened this issue 4 years ago • 2 comments

In the context of webtorrent-hybrid, I'm seeing stack traces such as the following:

/myapp/node_modules/electron-webrtc/src/RTCPeerConnection.js:189
          cb(offer)
          ^
TypeError: cb is not a function
    at /myapp/node_modules/electron-webrtc/src/RTCPeerConnection.js:189:11
    at Daemon.<anonymous> (/myapp/node_modules/electron-webrtc/src/RTCPeerConnection.js:277:11)
    at Object.onceWrapper (node:events:483:26)
    at Daemon.emit (node:events:376:20)
    at ChildProcess.<anonymous> (/myapp/node_modules/electron-eval/lib/index.js:195:27)
    at ChildProcess.emit (node:events:376:20)
    at DestroyableTransform.<anonymous> (/myapp/node_modules/electron-eval/lib/index.js:228:29)
    at DestroyableTransform.emit (node:events:376:20)
    at addChunk (/myapp/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:291:12)
    at readableAddChunk (/myapp/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:278:11)

See the definition of RTCPeerConnection.createOffer in this project.

Note that the MDN spec shows the three-argument version as deprecated.

Not visible in the stack trace, but createOffer is called by Peer._createOffer in simple-peer.

This is almost certainly the root cause of #52, though I'm not sure why this is manifesting in only some environments and not others when running webtorrent-hybrid.

CC @feross @yciabaud.

BkPHcgQL3V avatar Nov 30 '20 21:11 BkPHcgQL3V

Potentially fixed by #91. Looks like this project is dead, I suggest replacing it in dependencies with a maintained one.

BkPHcgQL3V avatar Nov 30 '20 21:11 BkPHcgQL3V

@BkPHcgQL3V Were you able to find a maintained alternative?

realkotob avatar Dec 23 '20 21:12 realkotob