Is anyone else getting a SendbirdError: Invalid parameter error just by using the ChannelList component?

In my React application, I’m using the SendbirdProvider with both the Channel and ChannelList components. The ChannelList component is constantly throwing the “Invalid Parameter” error. I’ve tried using the component with no props, and with the onSelectChannel prop, still get the error.

Has anyone else seen this behavior?

uikit v2.0.2
MacOS

Hello @mwq27,

First off, welcome to the Sendbird Community. We’re happy to have you here!
Could you provide your implementation of the UIKit please?

That would be really appreciated.

-Tyler

It’s basically like this:

// index.tsx
...
<SendBirdProvider appId="..." nickname=".." config={{ logLevel: 'all' }}>
  <Chat />
</SendBirdProvider>

// Chat.tsx
const Chat = () => {
  return (
    <div>
        <Channel channelUrl={channelUrl} />
        <ChannelList />
    </div>
  )
}

export default withSendBird(Chat);

@mwq27,

Thank you for that. Could you provide a stack trace of the error you’re seeing?

Thanks,
Tyler


It seems to come from this useEffect in the ChannelList component. I think ‘currentChannel’ is null, and that’s throwing an error in Sendbird.min.js. Here’s what shows in the console:

SendBird.min.js:6 Uncaught (in promise) SendBirdException: Invalid parameter.
at Function.get (http://localhost:3000/portal/v2/static/js/0.chunk.js:556173:16)
at Function.value (http://localhost:3000/portal/v2/static/js/0.chunk.js:556165:404)
at Function.value (http://localhost:3000/portal/v2/static/js/0.chunk.js:561217:21)
at http://localhost:3000/portal/v2/static/js/0.chunk.js:539007:22
at commitHookEffectListMount (http://localhost:3000/portal/v2/static/js/2.chunk.js:79515:30)
at commitPassiveHookEffects (http://localhost:3000/portal/v2/static/js/2.chunk.js:79552:15)
at HTMLUnknownElement.callCallback (http://localhost:3000/portal/v2/static/js/2.chunk.js:60094:18)
at Object.invokeGuardedCallbackDev (http://localhost:3000/portal/v2/static/js/2.chunk.js:60143:20)
at invokeGuardedCallback (http://localhost:3000/portal/v2/static/js/2.chunk.js:60196:35)
at flushPassiveEffectsImpl (http://localhost:3000/portal/v2/static/js/2.chunk.js:82616:13)
at unstable_runWithPriority (http://localhost:3000/portal/v2/static/js/2.chunk.js:91200:16)
at runWithPriority$1 (http://localhost:3000/portal/v2/static/js/2.chunk.js:70982:14)
at flushPassiveEffects (http://localhost:3000/portal/v2/static/js/2.chunk.js:82584:16)
at performSyncWorkOnRoot (http://localhost:3000/portal/v2/static/js/2.chunk.js:81499:7)
at http://localhost:3000/portal/v2/static/js/2.chunk.js:71036:28
at unstable_runWithPriority (http://localhost:3000/portal/v2/static/js/2.chunk.js:91200:16)
at runWithPriority$1 (http://localhost:3000/portal/v2/static/js/2.chunk.js:70982:14)
at flushSyncCallbackQueueImpl (http://localhost:3000/portal/v2/static/js/2.chunk.js:71031:11)
at flushSyncCallbackQueue (http://localhost:3000/portal/v2/static/js/2.chunk.js:71019:7)
at batchedUpdates$1 (http://localhost:3000/portal/v2/static/js/2.chunk.js:81624:11)
at Object.notify (http://localhost:3000/portal/v2/static/js/0.chunk.js:498081:7)
at Subscription.notifyNestedSubs (http://localhost:3000/portal/v2/static/js/0.chunk.js:498123:20)
at Subscription.handleChangeWrapper (http://localhost:3000/portal/v2/static/js/0.chunk.js:498128:12)

Does this get thrown when you load the channel list or when you click on a channel?

Just loading the ChannelList will throw it.

Thanks. Let me see if I can recreate this, and see if anything stands out.

I have not been able to recreate this error using UIKit 2.0.2. Can you provide me your compiled tsx? You can DM me if you’d prefer.

Thanks,
Tyler

Did you manage to resolve this issue?

I’m facing this issue when I’m rendering ChannelList directly, previously when I was rendering App (from sendbird-uikit) I couldn’t reproduce this.

Hi @oroce,

We have not yet resolved the issue but a colleague and I were able to reproduce the behavior. I’m currently investigating.

-Tyler

Thanks. In development mode the create-react-app shows a huge error screen due to the exception, fortunately, that’s not the case in production so we can live with it right now.

If I can help you resolve the issue let me know!

Cheers,

Robert