jeffkaufman/bucket-brigade

"Twilio is not defined" error

jimmosk opened this issue · 4 comments

I was just getting started with a quick test session (I just wanted to see the new share-an-image capability Jeff had told me about), so didn't bother with headphones in the calibration. I was using the current Firefox (85.0.2). It successfully detected latency via the beeps, then had me sing to test the mic. I started singing, clicked the I've Begun Singing button, and about five seconds later it crashed with this error:

ReferenceError: Twilio is not defined
update_preview_camera@https://echo.jefftk.com/demo.js:1540:3
connect_camera@https://echo.jefftk.com/demo.js:1529:3

Thanks for reporting this bug! I don't think skipping headphones in the calibration is related.

It sounds to me like Twilio (the provider we use for the video call portion) javascript failed to load. And then the first time the code tried to use Twilio (switching from volume calibration to choosing a camera) it crashed.

I wonder if maybe Twilio was having an issue? I haven't been able to reproduce this. Does it happen repeatedly for you?

Yes, it's repeatable on Firefox -- but I have no such problem with Chrome.

From the timing, I'm suspecting that Firefox crashes when it would normally pop up a box asking me to give permission to use the camera, similar to the box which popped up (several times) asking for microphone permission earlier in the calibration:
Screen Shot 2021-02-20 at 4 43 06 PM

Aha! I just noticed that the NoScript icon was indicating it was disallowing 1 site. I checked on that, and the site in question was twiliocdn.com. I put it on the safe list, and the crash no longer occurs -- I do get the expected popup permissions box, and everything proceeds normally.

That makes sense: if you block twiliocdn then Twilio won't work ;)