# App crashes when navigating away from chat

**URL:** <https://community.sendbird.com/t/app-crashes-when-navigating-away-from-chat/5163>\
**Category:** React\
**Tags:** javascript, uikit\
**Created:** [July 25, 2022, 9:47pm UTC](https://community.sendbird.com/t/app-crashes-when-navigating-away-from-chat/5163 "2022-07-25T21:47:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stlz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/stlz/32/2795_2.png) [@stlz](https://community.sendbird.com/u/stlz)\
**Post date:** [July 25, 2022, 9:47pm UTC](https://community.sendbird.com/t/app-crashes-when-navigating-away-from-chat/5163/1 "2022-07-25T21:47:22Z")

</div>

I’m using UIKit v3, OS is macOS Monterey.

I have a very simple implementation of chat going right now with a react application running on localhost.  
Chat functionality works fine - I can enter in messages and they get logged. However, when I navigate away from my chat component page and click on a different component, my whole application crashes, and this is due to the ChannelList. The error that I get in the console is `Sendbird error: Invalid parameters`. I’ve attached a screenshot below. Do you possibly know how to fix this error?

```auto
import React from "react";
import { useState } from "react";
import "@sendbird/uikit-react/dist/index.css";
import SBProvider from "@sendbird/uikit-react/SendbirdProvider";
import Channel from "@sendbird/uikit-react/Channel";
import ChannelList from "@sendbird/uikit-react/ChannelList";
import { useEffect } from "react";
import { BASE_API_URL } from "../../constants";
import axios from "axios";

export default function Chat({ currentUser, chatCounterpart, createChatUser }) {
  let [channelUrl, setChannelUrl] = useState("")

  useEffect(() => {
    if (currentUser && chatCounterpart) {
      createChatUser(chatCounterpart, chatCounterpart);
  
      // create a channel with these two users and return the url so we can display that channel
      axios
        .post(BASE_API_URL + "/createSendbirdChannel", {
          currentUser,
          chatCounterpart,
        })
        .then((res) => {
          setChannelUrl(res.data.channelUrl);
        })
    }
  }, [currentUser, chatCounterpart]);
  const APP_ID = process.env.REACT_APP_SENDBIRD_APP_ID;
  const App = () => {
    return (
      <div className="App">
        <SBProvider
          appId={APP_ID}
          userId={currentUser}
          nickname={currentUser}
        >
          <div className="customized-app">
            <div className="sendbird-app__wrap">
              <div className="sendbird-app__channellist-wrap">
                <ChannelList
                  onChannelSelect={(channel) => {
                    if (channel && channel.url) {
                      setChannelUrl(channel.url);
                    }
                  }}
                />
              </div>
              <div className="sendbird-app__conversation-wrap">
                <Channel
                  channelUrl={channelUrl}
                  replyType={"QUOTE_REPLY"}
                  isReactionEnabled={true}
                  disableUserProfile={true}
                  onChatHeaderActionClick={() => {
                    alert("match");
                  }}
                />
              </div>
            </div>
          </div>
        </SBProvider>
      </div>
    );
  };
  return App();
}

```

Thanks so much!

 ![Screen Shot 2022-07-25 at 3.49.52 PM](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/1/131cd8e1e2fe93acbae61556e2a5b403c97cf618.png)

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [July 26, 2022, 1:50am UTC](https://community.sendbird.com/t/app-crashes-when-navigating-away-from-chat/5163/2 "2022-07-26T01:50:26Z")

</div>

@stlz

Welcome to the Sendbird Community.

Would you be able to recreate this in something like CodeSandbox? It would help us be able to dig into this a bit deeper and see what is happening in real time.

---

<div class="post-metadata">

**Author:** ![stlz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/stlz/32/2795_2.png) [@stlz](https://community.sendbird.com/u/stlz)\
**Post date:** [July 26, 2022, 3:45am UTC](https://community.sendbird.com/t/app-crashes-when-navigating-away-from-chat/5163/3 "2022-07-26T03:45:27Z")

</div>

Hey Tyler,

Thanks for the reply! I’ve created something similar here: [https://codesandbox.io/s/adoring-darkness-uj53q0?file=/src/Chat.jsx](https://codesandbox.io/s/adoring-darkness-uj53q0?file=/src/Chat.jsx)

---

<div class="post-metadata">

**Author:** ![stlz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/stlz/32/2795_2.png) [@stlz](https://community.sendbird.com/u/stlz)\
**Post date:** [July 27, 2022, 6:53pm UTC](https://community.sendbird.com/t/app-crashes-when-navigating-away-from-chat/5163/4 "2022-07-27T18:53:13Z")

</div>

Bump on this! Thank you so much 🙂

---

<div class="post-metadata">

**Author:** ![gangeshwark](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/gangeshwark/32/2875_2.png) [@gangeshwark](https://community.sendbird.com/u/gangeshwark)\
**Post date:** [August 11, 2022, 6:40pm UTC](https://community.sendbird.com/t/app-crashes-when-navigating-away-from-chat/5163/5 "2022-08-11T18:40:48Z")

</div>

I have the exact issue. @Tyler please help! 🙂

---

<div class="post-metadata">

**Author:** ![taniel](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taniel](https://community.sendbird.com/u/taniel)\
**Post date:** [August 16, 2022, 7:56am UTC](https://community.sendbird.com/t/app-crashes-when-navigating-away-from-chat/5163/6 "2022-08-16T07:56:24Z")

</div>

same here. please help 🥲
