Sendbird SDK 在 react native 中需要 fs 包

Sendbird SDK requires fs package in react native

当我将 sendbird SDK 安装到 expo 管理的 React Native 项目中时,出现以下错误:

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

但是 fs 是一个节点包,它不是本机反应 运行 的环境。我查看了 Sendbird 示例,并在其他应用程序中使用了同样的 SDK。我做错了什么?

SendBird 在这里!抱歉,JavaScript 版本 3.0.119 中的一个已知问题导致了它。这将在下一个版本中修复,即将推出!同时,请根据需要使用3.0.118版本构建。

如果你正在使用 npm,你可以 运行 这个命令: npm install --save sendbird@3.0.118