Minified Javascript loaded does not expose Sendird

Hi I am attempting to utilize the sendbird.min.js. Current version is 4.0.9.

However, after the javascript is loaded on the page, the Sendbird variable in the global scope does not contain SendbirdChat as mentioned in the documentation (Send your first message | Chat JavaScript SDK | Sendbird Docs).

I am unable to get the SendbirdChat from the global Sendbird variable. However, other modules like GroupChannelModule and OpenChannelModule, and amongst many others are available.

Given this, I am not able to initialize the SendbirdChat client as the init method is available as part SendbirdChat.

output of the console.log of the global Sendbird variable.

Hi @James_Lee, and welcome to the Sendbird community!

Could you please provide a code example of how you are loading the modules into your application?

the easiest way is to copy and paste the .min.js directly into my browser console. it will result in the Sendbird variable being created but without the SendbirdChat module

@James_Lee,

How are you importing the SDK? Are you using <script> tags or are you importing them directly into the .js or .ts file for your application?

I was able to import the SDK in this example here on codesandbox.io.

Yes, I am importing it directly into the js. I have confirmed that the import from npm works but a new application environment doesn’t support es modules and fails to import from npm.

I have created another sandbox with the js copied in.

Hi @James_Lee

Can you help us understand why you’re not importing the file via a script tag? We’re having trouble with your code sandbox because it keeps crashing trying to load the entire minified text.

Regardless, I think the problem here is that SendbirdChat is a default export and thus the global variable you created is already SendbirdChat.

@Tyler Hi Tyler, I copied in because it was easier but I have created another sandbox that

  1. adds the sendbird.min.js
  2. loads through a tag
  3. console.logs(Sendbird) from the library.

Please review the console.log output of the Sendbird variable.

Hi @James_Lee,

I spent some time looking at this, we discovered a bug on our side and will look to getting this resolved as soon as possible. Apologies for the inconvenience.

1 Like

Thanks for raising this. Roughly do you have an idea on when a fix would be released?

Hi @James_Lee,

Chat v4.0.10 was released today that addresses the export issue of SendbirdChat. Please update to the latest version and let us know if you have any issues.