react-nativeexposendbird

Sendbird SDK requires fs package in react native


When I install the sendbird SDK into a expo managed react native project I get the following error:

The package at "node_modules/sendbird/SendBird.min.js" attempted to import the Node standard library module "fs". It failed because React Native does not include the Node standard library. Read more at https://docs.expo.io/versions/latest/introduction/faq/#can-i-use-nodejs-packages-with-expo

However fs is a node package which isn't the environment run by react native. I've looked through the Sendbird examples, and have used this very same SDK in other apps. What am I doing wrong with this one?


Solution

  • SendBird here! Our apologies, but there is a known issue in JavaScript version 3.0.119 that is causing it. This will be fixed in the next version, coming very soon! In the meantime, please build with version 3.0.118 as needed.

    If you are using npm, you can run this command: npm install --save sendbird@3.0.118