# Uncaught TypeError: Cannot read property 'readyState' of null

**URL:** <https://devforum.zoom.us/t/uncaught-typeerror-cannot-read-property-readystate-of-null/54067>\
**Category:** Web\
**Created:** [July 13, 2021, 8:58am UTC](https://devforum.zoom.us/t/uncaught-typeerror-cannot-read-property-readystate-of-null/54067 "2021-07-13T08:58:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoaib](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shoaib/32/28580_2.png) [@shoaib](https://devforum.zoom.us/u/shoaib)\
**Post date:** [July 13, 2021, 8:58am UTC](https://devforum.zoom.us/t/uncaught-typeerror-cannot-read-property-readystate-of-null/54067/1 "2021-07-13T08:58:26Z")

</div>

**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?**  
@zoom1234/videosdk - 1.1.0

**Screenshots**

 ![Screenshot 2021-07-13 at 2.21.30 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/c/f/cfd653ffa30a0226f8dcc83167ce6209c6f2b421.png)

**Device (please complete the following information):**

- OS: MacOS

**Additional context**  
This is the code:

```auto
  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');
      });
  }

```

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [July 14, 2021, 1:43am UTC](https://devforum.zoom.us/t/uncaught-typeerror-cannot-read-property-readystate-of-null/54067/2 "2021-07-14T01:43:56Z")

</div>

Hey @shoaib

Thanks for your feedback.

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

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![shoaib](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shoaib/32/28580_2.png) [@shoaib](https://devforum.zoom.us/u/shoaib)\
**Post date:** [July 28, 2021, 4:34pm UTC](https://devforum.zoom.us/t/uncaught-typeerror-cannot-read-property-readystate-of-null/54067/3 "2021-07-28T16:34:56Z")

</div>

I am using `offline-js` [package](https://github.hubspot.com/offline/docs/welcome/) after disabling it, the error went away.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 2, 2021, 7:49pm UTC](https://devforum.zoom.us/t/uncaught-typeerror-cannot-read-property-readystate-of-null/54067/4 "2021-08-02T19:49:57Z")

</div>

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

Let us know if you need anything else!

-Tommy

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [September 10, 2021, 11:01pm UTC](https://devforum.zoom.us/t/uncaught-typeerror-cannot-read-property-readystate-of-null/54067/6 "2021-09-10T23:01:22Z")

</div>

Closed on September 10, 2021, 11:01pm UTC

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