kimobrian / TwilioReact

A React Video Chat app using Twilio Video
MIT License
56 stars 31 forks source link

Error when running `npm start` #8

Open ericpereira-psl opened 5 years ago

ericpereira-psl commented 5 years ago

After cloning the repository and installing all required modules, I ran npm start only to be presented with the following error:

Uncaught TypeError: Cannot read property '1' of null
    at Object.<anonymous> (getstats.js:13)
    at __webpack_require__ (bootstrap 2e70af806891cc226553:678)
    at fn (bootstrap 2e70af806891cc226553:88)
    at Object.<anonymous> (index.js:8)
    at __webpack_require__ (bootstrap 2e70af806891cc226553:678)
    at fn (bootstrap 2e70af806891cc226553:88)
    at Object.<anonymous> (createlocaltracks.js:5)
    at __webpack_require__ (bootstrap 2e70af806891cc226553:678)
    at fn (bootstrap 2e70af806891cc226553:88)
    at Object.<anonymous> (connect.js:7)

Seems to be an issue in webpack:///./node_modules/@twili/webrtc/lib/getstats.js on lines 12-14:

var chromeMajorVersion = isChrome
  ? parseInt(navigator.userAgent.match(/Chrome\/([0-9]+)/)[1], 10)
  : null;

I have made sure that I am using the latest twilio and twilio-video npm modules as mentioned here: https://support.twilio.com/hc/en-us/articles/360012782494-Breaking-Changes-in-Twilio-Video-JavaScript-SDKs-December-2018-

Any idea how to fix this as I can't proceed with any development.

If it helps, I am using Node v11.1.0 and using Google Chrome v73.0.3683.20 (Official Build) dev (64-bit) to test.

ericpereira-psl commented 5 years ago

Turns out if you switch to the device toolbar in Google Chrome and select an iOS device, the above error occurs. Switch to Galaxy S5 or even out of the device toolbar and everything works fine. Is this a Twilio issue or Google Chrome issue?

kimobrian commented 5 years ago

I can't tell for sure but I've had issues running this app in Safari. Will look further into it when I find sometime