简体   繁体   English

不变违规:模块 JSTimers 不是注册的可调用模块(调用 callTimers)。由于 lerna 设置中的设备信息 package 导致的问题

[英]Invariant Violation: Module JSTimers is not a registered callable module(calling callTimers).Issue due to device-info package in lerna setup

React Native version:反应原生版本:

0.64.0 0.64.0

Steps To Reproduce重现步骤

[Repo-code] https://github.com/rsoni5519/lerna-react-native [回购代码] https://github.com/rsoni5519/lerna-react-native

  • Please use above link and follow the steps described in README.请使用上面的链接并按照自述文件中描述的步骤进行操作。

Expected Results预期成绩

The App should work when we are clicking on Track buttons.当我们单击 Track 按钮时,该应用程序应该可以工作。 it should console values for respective button events.它应该控制相应按钮事件的值。 userAgent and screenSize should work for DeviceInfo and Dimensions. userAgent 和 screenSize 应该适用于 DeviceInfo 和Dimensions。 Module_JsTimer_Issue steps to reproduce Module_JsTimer_Issue重现步骤

Error occurred because of cyclic dependency of react-native pakcage.由于 react-native 封装的循环依赖性而发生错误。

Use this repository for solution [a link] ( https://github.com/vishalkhoje/cyclicImportReactNative )!将此存储库用于解决方案 [a link] ( https://github.com/vishalkhoje/cyclicImportReactNative )!

  1. Here problem is install react-native-device-info package as dependency into your root project not in your custom package.这里的问题是将react-native-device-info package 作为依赖项安装到您的根项目中,而不是在您的自定义 package 中。
  2. In your custom package use react-native-device-info adn react-native as a peer dependancy.在您的自定义 package 中,使用 react-native-device-info 和 react-native 作为对等依赖项。 Ex.前任。 This is in your custom package.json file, important is version of package is same as root project package.json file. This is in your custom package.json file, important is version of package is same as root project package.json file.
"peerDependencies": {
    "react-native": "^0.64.1",
    "@types/react-native": "^0.64.5",
    "react-native-device-info": "^8.1.2"
  }

This will solve your problem.这将解决您的问题。

:[Output screenshot:] :[输出截图:] 在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不变违规:模块“AppRegistry”不是已注册的可调用模块(调用“runApplication”)。 等等 - Invariant Violation: Module `AppRegistry` is not a registered callable module (calling `runApplication`). and etc 不变违规:模块 AppRegistry 不是已注册的可调用模块(调用 unmountApplicationComponentAtRootTag) - Invariant Violation: Module AppRegistry is not a registered callable module (calling unmountApplicationComponentAtRootTag) React Native:模块JSTimers不是已注册的可调用模块 - React Native: Module JSTimers in not a registered callable module React Native - Xcode 12.1 & iOS 14.0.1 不变违规:模块 AppRegistry 不是注册的可调用模块(调用 runApplication) - React Native - Xcode 12.1 & iOS 14.0.1 Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) React Native & iOS:不变违规:模块 RCTDeviceEventEmitter 不是注册的可调用模块(调用发射) - React Native & iOS : Invariant Violation: Module RCTDeviceEventEmitter is not a registered callable module (calling emit) 不变违规:模块 AppRegistry 不是注册的可调用模块(调用 runApplication) - 反应原生 - Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) - react native React Native WatermelonDB Invariant Violation:Module AppRegistry 不是注册的可调用模块(调用runApplication) - React Native WatermelonDB Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) 不变违规:模块 AppRegistry 不是已注册的可调用模块(调用 runApplication)从 0.60.5 升级到 0.63.3 - Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) upgrading from 0.60.5 to 0.63.3 不变违规:模块 AppRegistry 不是注册的可调用模块(调用 runApplication)。 错误的一个常见原因是 - Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the React-Native: Invariant Violation: Module AppRegistry 不是注册的可调用模块(调用runApplication) - React-Native: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM