# "There was a network error" when trying to connect to sendbird client when operator

**URL:** <https://community.sendbird.com/t/there-was-a-network-error-when-trying-to-connect-to-sendbird-client-when-operator/7234>\
**Category:** JavaScript\
**Created:** [May 5, 2023, 6:44pm UTC](https://community.sendbird.com/t/there-was-a-network-error-when-trying-to-connect-to-sendbird-client-when-operator/7234 "2023-05-05T18:44:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![devluked](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/devluked/32/3556_2.png) [@devluked](https://community.sendbird.com/u/devluked)\
**Post date:** [May 5, 2023, 6:44pm UTC](https://community.sendbird.com/t/there-was-a-network-error-when-trying-to-connect-to-sendbird-client-when-operator/7234/1 "2023-05-05T18:44:52Z")

</div>

## **[Problem/Question]** When calling the connect function with my sendbird client, getting “there was a network error”

**[SDK Version]**  
“@sendbird/chat”: “^4.7.1”,  
“@sendbird/uikit-react”: “^3.4.5”,

**[Reproduction Steps]**

```auto
 const sb = SendbirdChat.init({
    appId: appId,
    modules: [new OpenChannelModule()],
  });

```

```auto
useEffect(() => {
    const connectUser = async () => {
      setLoading(true);
      try {
        await sb
          .connect(user.id)
          .then(async () => {
            await enterChannel();
          })
          .catch((err) => {
            setChatError(err);
            console.log(err);
            return;
          });
      } catch (err) {
        toast({
          title: err,
          status: "error",
          duration: 3000,
        });
      } finally {
        setLoading(false);
      }
    };

    connectUser();
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [sb]);

```

**[Frequency]**  
Everytime I try joining chat as an operator

**[Current impact]**  
Unable to moderate my chat

---

<div class="post-metadata">

**Author:** ![Miyoung\_Han](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/miyoung_han/32/183_2.png) [@Miyoung\_Han](https://community.sendbird.com/u/Miyoung_Han)\
**Post date:** [June 5, 2023, 11:54pm UTC](https://community.sendbird.com/t/there-was-a-network-error-when-trying-to-connect-to-sendbird-client-when-operator/7234/2 "2023-06-05T23:54:30Z")

</div>

Hi @devluked

Welcome to the Sendbird Community!

It seems that you are using our React UIKit as well.  
Could you elaborate on why you are trying to connect to Sendbird via SendbirdChat directly, not via UIKit?

---

<div class="post-metadata">

**Author:** ![devluked](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/devluked/32/3556_2.png) [@devluked](https://community.sendbird.com/u/devluked)\
**Post date:** [July 5, 2023, 4:20pm UTC](https://community.sendbird.com/t/there-was-a-network-error-when-trying-to-connect-to-sendbird-client-when-operator/7234/3 "2023-07-05T16:20:57Z")

</div>

The UIkit connection wasn’t working for some reason, so I had to opt for a mix of both. Ill try it again though.
