Uncaught TypeError: Cannot read property 'readyState' of null

Description

Error
I’m getting the following error while joining a session using join method.

index.umd.js?af5c:formatted:3635 Uncaught TypeError: Cannot read property ‘readyState’ of null
at a (index.umd.js?af5c:formatted:3635)
at XMLHttpRequest.xhr.onprogress.xhr.onload (offline.js?abd9:86)

Which Web Video SDK version?
@zoom/videosdk - 1.1.0

Screenshots

Device (please complete the following information):

  • OS: MacOS

Additional context
This is the code:

  const zmClient = ZoomVideo.createClient();

  useEffect(() => {
    init();
    
    return () => {
      ZoomVideo.destroyClient();
    };
  }, []);

  const init = () => {    
    console.log('Initialziing session...');
    
    zmClient.init('en-US', `${window.location.origin}/codepair-assets/lib`).then(() => {
      const signature = generateVideoToken(creds.sdkKey, creds.sdkSecret, slug);
      join(signature, slug, name)
    })
    .catch(e => {
      console.log(e, 'Initialziing error');
    });
  };

  const join = (signature: string, topic: string, username: string) => {
      console.log('Joining the session...');
      console.log(topic, signature, username);

      zmClient.join(topic, signature, 'username').then((data) => {
        console.log(data)

      // if (!mediaStream) setMediaStream(zmClient.getMediaStream());
      console.log(mediaStream)
      })
      .catch((e) => {
        console.log(e, 'Joining error');
      });
  }

Hey @shoaib

Thanks for your feedback.

According to the error on the console, your network may be unstable.

Thanks
Vic

1 Like

I am using offline-js package after disabling it, the error went away.

1 Like

Happy to hear you were able to resolve your issue @shoaib ! :slight_smile:

Let us know if you need anything else!

-Tommy

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.