react-native - 未设置 fbBatchedBridgeConfig
问题描述
yarn test
在反应本机移动应用程序上运行时出现错误。
Test suite failed to run
Invariant Violation: __fbBatchedBridgeConfig is not set, cannot invoke native modules
2 | // import console = require('console');
3 |
> 4 | if (!NativeModules.DeviceMotionModule) {
| ^
5 | throw new Error('Native modules for sensors not available. Did react-native link run successfully?')
6 | }
7 |
at invariant (node_modules/invariant/invariant.js:40:15)
at Object.invariant (node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:162:3)
at Object.require [as NativeModules] (node_modules/react-native/Libraries/react-native/react-native-implementation.js:322:12)
at Object.NativeModules (src/NativeModules/SensorsIOS/sensors.js:4:6)
我是开玩笑测试的新手。
我的项目中有一组适用于 IOS 和 Android 的 costum 原生模块(不是 npm 模块)。
解决方案
推荐阅读
- c# - C# WPF 如何在 MultiBinding 中使用自定义 ComboBox 项属性
- docker - 在 docker compose build 中定义预处理器变量
- python - 带有自定义消息的 Python Telegram 机器人回调不起作用
- python - tkinter.Text() 错误(_tkinter.TclError:预期的整数,得到“sans”)
- python - Python - 如何通过代理发送邮件
- javascript - 在div中动态创建多个表jquery
- javascript - 一个动作完成后如何在 React js 中调度一个动作?
- botframework - Microsoft Bot Framework - Directline 任务已取消
- dart - Dart:打印整数和字符串
- javascript - SAPUI5 从同一控制器中的另一个函数调用函数