I don’t know whether it is out of date, but it just isn’t working. When I try to import sendbird and initialise a connection, I get an error saying Unable to resolve module fs from 'node_modules/sendbird/SendBird.min.js
This is how to repro
I created my project using the React Native CLI ( react-native init ChatApp )
I installed Sendbird with npm (npm install sendbird)
I then tried to import the module (import SendBird from ‘sendbird’; in app.js)
Can someone tell me where I am going wrong here? I feel it is something to do with the sendbird dependency not being in the right place (maybe its not meant to be installed by npm - but this is what the tutorial advised)
The blog link you shared was written in November of 2017 (3 years ago!!!) which is not probably best one to follow. (I delivered this information to our team)
For latest sample app that you want to use can be found
and we just released UI Kit today which you can also check out at
Unfortunately, I still can’t get it working in react native - found this issue (https://github.com/sendbird/SendBird-JavaScript/issues/113) which seems similar although I tried to downgrade to 3.0.117 as per the answer and it still didn’t work.
As I am new to javascript and react-native world, please would you be able to give me more explicit instructions on how I can install sendbird into my react-native app (using npm?) and then import into my script? Apologies if this is very basic but I have been struggling with this for two days now
Hey @emmad ! Please post your metro.config.js and package.json.
The error message you’re getting from Metro bundler shows that you’re trying to run fs, which is a Node js core module. We’ve all been here at one point or another, so don’t feel bad
There are a few ways to go about this, here’s two:
Best Approach Include a resolver: { extraNodeModules: … } config in your metro.config.js file. Here can learn more here: Metro Docs: Resolver Options
Alternatively, you can use a library like rn-nodeify but this adds a ton of extra weight to your App. However, it’s super useful if you’ll be using other core Node modules (ex. crypto for hashing, etc)
Lastly, since you mentioned you’re new to JS and React Native, I’d highly recommend spending a day or two on this React Native course from Harvard’s CS50 classes. It’s on Youtube and totally free (the guy speaks a bit slow so I recommend putting it on speed 1.5x haha). It’s one of the best series of videos out there on RN. Unlike most “tutorials”, this one is really well-grounded on CS and software engineering:
Thanks so much for this detailed response. I actually downgraded my sendbird package to 3.0.117 THEN re read cd iod, pod install, cd … (which I hadn’t done in my previous post) and it worked without the fs error. Thanks for the info about rn-nodeify though, it looks very helpful.
@emmad Thanks great that you got it working and our apologies for the problem you had to go through. But I am happy that you are getting closer to the launch!
Once you launch your project, would you like to share your project with other SendBird community members by sharing details in show & tell category? (https://community.sendbird.com/c/show-tell/7)
And please let us know if you have any other problems moving forward !!
Hey @emmad! Awesome glad you’re making progress. I replied to your other Q&A with the solution and got your app running on my laptop! Go check it out and good luck )