[React Native] TypeError: undefined is not an object (evaluating 'Vn.of(this._iid).fetch')

I am using v4 JS SDK with React Native.

{
   "@sendbird/chat": "^4.0.0",
   "react-native": "0.67.3"
}

Can you help me with this error?
I am getting this error while trying to call sb.connect()

TypeError: undefined is not an object (evaluating 'Vn.of(this._iid).fetch')

following is my code snippet

   const sendbird = SendbirdChat.init({
      appId: SENDBIRD_CHAT_APP_ID,
      modules: [new OpenChannelModule()],
      logLevel: LogLevel.DEBUG,
    });

    const user = await sendbird.connect(profileData.id);

@Jabir_Muhammad Hi there. Please can you share the wider context of your code? I’m interested to see your sendbird imports and also the async function you are wrapping your await statement with.

Also is the file type you are writing in .js or .ts?

@Jason Hi,
I am connecting to sendbird using react Context ChatContext.tsx

import SendbirdChat, { LogLevel } from '@sendbird/chat';
....


const connectSendbird = useCallback(async ()=>{

    const sendbird = SendbirdChat.init({
      appId: SENDBIRD_CHAT_APP_ID,
      modules: [new OpenChannelModule()],
      logLevel: LogLevel.DEBUG,
    });

    sendbirdRef.current = sendbird;
   
    try {
       const user = await sendbird.connect(profileData?.id || '');
       console.log('sendBird:connectedUser', user);
    } catch(error){
       console.error('sendBird:connectedUserError', error);
    }


},[profileData])

@Jabir_Muhammad Hi there. Thanks for the code snippet.

Please can I double check that you import the OpenChannelModule?

import { OpenChannelModule } from '@sendbird/chat/openChannel';

@Jason Yeah, I have imported OpenChannel Module like that.

import { OpenChannelModule, OpenChannelHandler, OpenChannel } from '@sendbird/chat/openChannel';

Having the exact problem as @Jabir_Muhammad .

1 Like

@Jabir_Muhammad @kavindu_tinto Hi there. I trust you are both well.

Sendbird’s engineers have been working to fix the above issue. Please can you install the latest version of the JS SDK. As of writing that would be v4.0.3. :slight_smile:

1 Like

@Jason I can confirm that this specific issue has been fixed. Thank you for the update.

@Jason Thanks, v4.0.3 fixes this specific issue. But I have another problem with disconnect. Please check my new thread.