android - “TypeError: undefined is not an object (evalating '_react.PropTypes.array')” 在 Mac 上反应原生
问题描述
我在本机反应中遇到了问题。我的 React 原生项目完全在 windows 环境下工作。然后我在 Mac 系统中克隆了这个相同的项目并尝试运行这个项目,它抛出了一个错误。“TypeError: undefined is not an object (evalating '_react.PropTypes.array')”。我的项目没有显示 PropTypes 的任何结果。我已经多次重启服务器。我尝试了不同的解决方案,但没有任何效果。请帮我解决这个问题
这是我的节点日志
ERROR TypeError: undefined is not an object (evaluating '_react.PropTypes.array')
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
解决方案
我解决了这个问题。花了很多时间来确定问题。在我的项目“react-native-snap-carousel”库中抛出这个错误,在检测到问题后我点击了这个链接:
npm install prop-types --save // install this
import PropTypes from 'prop-types'; // add import in snap carousel file & remove PropTypes from 'react-native'
推荐阅读
- ssas-tabular - 表格对象模型的 Tableau 性能问题
- ruby-on-rails - Sidekiq 宝石与 Ruby 1.9.3
- python - Django 如何仅在 CBV 列表视图中显示可用项目?
- ruby-on-rails - Devise用户中的“provider”和“uid”是什么意思?
- c# - 未找到端点。WCF C#
- sql-server - 在 Google BigQuery 中拆分
- html - 调整窗口大小导致文本下推图像
- api - 来自 WebApp 的 Hyperledger Composer Rest 服务器查询
- java - 如果我们在指定时间内没有得到响应,如何关闭 API 连接
- elasticsearch - 在 elasticsearch 中哪个更好的滚动或 search_after 来模拟随机分页?