Hi! This is the first time I'm asking a question here at DEV :) Hope you can shed some light on this thing.
I decided to move the code to EmberJS. At first, it was going good BUT
when I imported the
twilio-video package in a class file, this error appeared in the browser and halted the execution of the app:
TypeError: 'get peerIdentity' called on an object that does not implement interface RTCPeerConnection.
Of course, I found a related issue in the library GitHub page and it suggested upgrading to a recent version. I did it but the error didn't go away. I even downgraded the library to the same version I was using in the Svelte project but it kept happening.
- [x] I have verified that the issue occurs with the latest twilio-video.js release and is not marked as a known issue in the CHANGELOG.md.
- [x] I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
- [x] I verified that the Quickstart application works in my environment.
- [x] I am not sharing any Personally Identifiable Information (PII) or sensitive account information (API keys, credentials, etc.) when reporting this issue.
Code to reproduce the issue:
import TwilioVideo from 'twilio-video'
...in Firefox 70+ with
media.peerconnection.enabled set to
Twilio SDK should see that WebRTC is not available and still allow other functions on the page to work.
Entire page is brought down at import time by undefined reference to global
When I tried patching around this, I hit another undefined reference to
These references both need to be fixed to ensure importing Twilio-Video, even when WebRTC is disabled, doesn't break non-call related functions on the page. The simplest fix would seem to be accessing both via
- Browser(s): Firefox 70+
- Operating System: Linux, but likely all
- twilio-video.js: 2.0.0-beta15
- Third-party libraries (e.g., Angular, React, etc.): not relevant
Just out of curiosity, I tried the complaining version
twilio-video 2.0.0-beta16 in the Svelte project and guess what? It worked!
With Svelte the error doesn't happen!
But I'm still stucked in the EmberJS app so I need a solution to keep going.
Fortunately, the Twilio Video library can be used with a CDN and I proceeded to use it that way. The error keeps showing up but it doesn't halt the normal execution of the EmberJS app.
So now I face the question Why does this happen in EmberJS and not in Svelte? To my knowledge, Svelte is kind of a compiler and that could be related.
Is there a way to keep using the NPM version of the library in a way that the error doesn't break the app?