Metro两次在iOS上运行两次加载index.js

时间:2018-08-14 03:28:21

标签: react-native

在向我的RN项目添加了一些依赖项(如babel,android-js和mobx)之后,我尝试在ios上运行我的项目,但未成功。我收到此错误:“应用程序passenger_app_rx尚未注册.....”,图像中的更多内容。

This error only happens on ios

另外,我注意到在运行react-native run-ios时,城域服务器将两次加载index.js,以确保ios配置错误。 Metro bundler, loading index.js twice

项目设置: react-native-cli:2.0.1 反应本机:0.56.0

package.json

{
  "name": "passenger_app_rx",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "run-android": "cd ./android && ./gradlew app:assembleDebug && ./gradlew installDebug"
  },
  "dependencies": {
    "@babel/core": "7.0.0-beta.47",
    "@babel/plugin-proposal-decorators": "7.0.0-beta.47",
    "@mapbox/geo-viewport": "^0.4.0",
    "babel-core": "7.0.0-beta.3",
    "jsc-android": "224109",
    "mapbox": "^1.0.0-beta10",
    "mobx": "^5.0.3",
    "mobx-react": "^5.2.3",
    "prop-types": "15",
    "react": "16.4.1",
    "react-native": "0.56.0",
    "react-native-fbsdk": "^0.7.0",
    "react-native-navigation": "^2.0.2453"
  },
  "devDependencies": {
    "babel-jest": "23.4.0",
    "babel-preset-react-native": "^5",
    "jest": "23.4.1",
    "react-test-renderer": "^16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

0 个答案:

没有答案