- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
还有许多其他具有相同标题的帖子,但是其中大多数都已过时,并且答案对我不起作用。这些是我尝试过的一些失败的修复:
BUNDLE ./index.js
WARN Require cycle: src\component\FeedList.js -> src\component\FeedCell.js -> src\component\TagDetail.js -> src\component\FeedList.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
ERROR ReferenceError: Can't find variable: i
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.
当我重新加载应用程序时,我得到了同样的错误,但有 4 个相同的不变违规而不是 2 个。(注意这一点是相关的)
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { AppRegistry} from 'react-native';
import { createStackNavigator} from "react-navigation-stack";
//import { StackNavigator } from 'react-navigation';
import { createAppContainer } from 'react-navigation';
import App from './src/App';
import configureStore from './src/store/index';
import TagDetail from './src/component/TagDetail';
import FeedDetail from './src/component/FeedDetail';
import UserDetail from './src/component/UserDetail';
import SettingsPage from './src/SettingsPage';
import About from './src/About';
import {name as appName} from './app.json';
const store = configureStore();
const AppNavigator = createStackNavigator({
Home: {
screen: App
},
TagDetail: {
screen: TagDetail
},
FeedDetail: {
screen: FeedDetail
},
UserDetail: {
screen: UserDetail
},
SettingsPage: {
screen: SettingsPage
},
AboutPage: {
screen:About
}
},{
headerMode: 'none'
});
export default class Root extends Component {
render() {
return (
<Provider store={store}>
<Apps/>
</Provider>
)
}
}
AppRegistry.registerComponent(appName, () => Root);
const Apps = createAppContainer(AppNavigator);
//export default Apps;
包.json
{
"name": "TestApp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/async-storage": "^1.11.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/viewpager": "^4.0.0",
"aws-sdk": "^2.693.0",
"lodash": "^4.17.15",
"lodash.debounce": "^4.0.8",
"react": "16.13.1",
"react-native": "^0.64.1",
"react-native-deprecated-custom-components": "^0.0.0",
"react-native-gesture-handler": "^1.10.0",
"react-native-image-crop-picker": "^0.31.1",
"react-native-image-picker": "^2.3.1",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-material-menu": "^1.2.0",
"react-native-navbar": "^2.1.0",
"react-native-parallax-scroll-view": "^0.21.3",
"react-native-photo-view": "^1.5.2",
"react-native-safe-area-context": "^3.0.2",
"react-native-screens": "^2.8.0",
"react-native-scrollable-tab-view": "^1.0.0",
"react-native-swiper": "^1.6.0-rc.1",
"react-native-tab-navigator": "^0.3.4",
"react-native-text-ticker": "^1.5.0",
"react-native-vector-icons": "^8.1.0",
"react-native-vertical-view-pager": "^0.1.1",
"react-native-video": "^4.4.5",
"react-native-view-pager": "^0.2.3",
"react-navigation": "^4.3.9",
"react-navigation-stack": "^2.6.0",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"styled-components": "^5.1.1"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/runtime": "^7.10.2",
"@react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^26.0.1",
"eslint": "^7.2.0",
"jest": "^26.0.1",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.13.1"
},
"jest": {
"preset": "react-native"
}
}
应用程序.json
{
"name": "TestApp",
"displayName": "TestApp"
}
最佳答案
如果循环在您自己的代码中,则必须将一些导出提取到第三个模块/文件中,然后将代码导入到之前形成循环的两个模块中。
This may help
关于javascript - react 原生 "Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67443639/
目前我能想到三种情况: 不包含任何资源的程序集 在其资源文件中仅包含图像(即 ToolBoxBitmaps)的控制库 仅包含用于抛出异常的文本的库(无论如何我们都不希望用户看到这些,对吗?;-)) 我
我正在学习一门强调使用不变量的中级编程类(class)。我以前从未使用过它们,它们似乎需要更多的时间来创建。软件工程行业是否强调使用不变量? 最佳答案 取决于你问谁 - 我使用不变量只是因为它让生活更
作为我学习的一部分,我认为我发现的抽象定义的最佳答案(有意义)来自 stackoverflow: What is abstraction? 除此之外, 作为 2006 年秋季伯克利在线类(class)
我正在试验 Code Contract,但遇到了一个问题。我有课: public class SpecialPoint { public int X { get; set; } pub
有人可以给我举个例子吗 invmap :: (a -> b) -> (b -> a) -> f a -> f b Invariant 有什么好处? 最佳答案 大多数情况下,人们不使用Invarian
我发现我的机器和构建服务器上的测试结果不同。我设法找到了不同的单行。这是一个字符串比较。这两个字符串的第一个字符不同。 下面的测试在我的本地机器上通过了,但在构建机器上失败了。 [TestClass]
尽管 _foo 不可能为 null,但下面的简单代码将由代码契约的静态检查器产生“不变的未经证实”的警告。该警告针对 UncalledMethod 中的 return 语句。 public class
我有一个像这样设置的 React 项目: 这是一个简单的应用程序。 Dashboard 有一个 UserListContainer,其中包含一个 UserList,其中列出了四个用户及其 ID 和姓名
我正在使用 React JS 构建一个应用程序,到目前为止我很喜欢它。但是,我遇到了一个错误,而且我很难确定我做错了什么。这是我的错误: 未捕获错误:不变违规:ImageList.render():必
我不明白这条消息想告诉我什么: CodeContracts: invariant unproven: _uiRoot != null && _uiRoot.Children != null && _u
我已经创建了 VenueList 组件。我想在 native 应用程序中使用 FlatList 组件显示列表。我收到错误消息:Invariant Violation 试图让帧超出范围索引(参见屏幕截图
尝试添加 onClick 时出现以下错误属性(property)给表格内的元素。这是我的错误: Invariant Violation: findComponentRoot(...) ... Unab
最初我的 mongod 进程运行良好。我发现我的虚拟机上有空间紧缩,所以删除了 2 个较旧的 oplog 文件以释放空间。然后接下来我启动 mongod 并开始出现错误。然后我尝试在本地数据库中修复我
我有一个Angular 11项目,试图集成SpreadJS Designer,但在ngcc步骤Compiling @grapecity/spread-sheets-designer-angular :
我正在寻找一种有条理的方法来追踪哪个组件在不熟悉的代码库中导致了“未捕获的不变违规”错误。特别是在运行不输出堆栈跟踪的业力测试套件时。 我最幸运的是将 console.log(JSON.stringi
设置状态导致第二次渲染后 react 测试失败 到目前为止,JSDOM 和 Mocha 的测试进展顺利。到目前为止,还没有必要测试任何改变其状态的组件。我发现我的第一个问题是测试更改其状态的组件。 错
这是一个典型的 react 问题,但我有点不知道如何处理它。我只想动态渲染我的表格线,但我收到错误:”“未捕获错误:不变违规:processUpdates():无法找到元素的子元素 2。这可能意味着
我知道错误来自嵌套的东西和嵌套_.map功能,但我不知道如何做到这一点。 渲染函数的一部分如下: 我想做的是: 检查是this.props.currencylist存在 然后显示下拉菜单 与 来自th
由于缺乏对 Commonjs 模块的支持,在对 React_rails gem 感到沮丧之后,我正在测试 react_webpack_rails来自 netguru 的 gem 。但从那时起我就遇到了
在 JEST 中为 React 文件编写测试用例时,我收到此错误。以下是我的示例代码: search_basr_test.js jest.autoMockOff(); global.React = r
我是一名优秀的程序员,十分优秀!