首页 > 解决方案 > Expo ErrorRecovery 无法解决

问题描述

尝试在 expo 中查看应用程序时会发生此错误。

Unable to resolve "./ErrorRecovery/ErrorRecovery" from "node_modules/expo/build/ExpoLazy.js" Failed building JavaScript bundle.

我有 expo sdk 36.0.0

世博会-cli 3.13.8

在 macOS 10.15.5 上运行

我已经删除了node_modules package-lock.json yarn.lock .expo。然后npm install。我还清除了缓存npm cache clear -f并运行expo start -c

Unable to resolve "./ErrorRecovery/ErrorRecovery" from "node_modules/expo/build/ExpoLazy.js" Failed building JavaScript bundle.

包.json

{
  "scripts": {
    "postinstall": "jetify && jetify",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "sudo react-native start --reset-cache",
    "test": "jest"
  },
  "dependencies": {
    "@react-native-community/async-storage": "^1.8.1",
    "@react-native-community/blur": "^3.6.0",
    "events": "^3.1.0",
    "expo": "^36.0.0",
    "expo-barcode-scanner": "~8.0.0",
    "expo-blur": "~8.0.0",
    "expo-font": "~8.0.0",
    "expo-camera": "~8.0.0",
    "expo-linear-gradient": "~8.0.0",
    "expo-location": "~8.0.0",
    "expo-permissions": "~8.0.0",
    "expo-secure-store": "~8.0.0",
    "hermesvm": "^0.1.1",
    "http": "0.0.0",
    "jwt-decode": "^2.2.0",
    "native-base": "^2.13.8",
    "node-libs-browser": "^2.2.1",
    "node-libs-react-native": "~1.2.0",
    "react": "16.9.0",
    "react-dom": "16.8.3",
    "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
    "react-native-camera": "^3.19.0",
    "react-native-collapsible": "^1.5.1",
    "react-native-credit-card-input": "^0.4.1",
    "react-native-crypto-js": "^1.0.0",
    "react-native-elements": "^1.2.7",
    "react-native-extra-dimensions-android": "^1.2.5",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-global-props": "^1.1.5",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-keyboard-spacer": "^0.4.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-maps": "~0.26.1",
    "react-native-masked-text": "^1.13.0",
    "react-native-modal": "^11.5.4",
    "react-native-reanimated": "~1.4.0",
    "react-native-router-flux": "^4.2.0",
    "react-native-screens": "2.0.0-alpha.12",
    "react-native-scroll-bottom-sheet": "^0.6.1",
    "react-native-simple-radio-button": "^2.7.4",
    "react-native-swipe-gestures": "^1.0.5",
    "react-native-swipe-list-view": "^2.3.0",
    "react-native-swiper": "^1.6.0-rc.3",
    "react-native-unimodules": "~0.6.0",
    "react-native-vector-icons": "^6.6.0",
    "stripe-client": "^1.1.5"
  },
  "devDependencies": {
    "@babel/core": "^7.8.7",
    "@types/react": "^16.9.23",
    "@types/react-native": "^0.57.65",
    "babel-jest": "24.9.0",
    "babel-preset-expo": "^7.1.0",
    "jest": "24.9.0",
    "jest-expo": "^36.0.0",
    "jetifier": "^1.6.5",
    "metro-react-native-babel-preset": "0.56.0",
    "react-test-renderer": "16.9.0",
    "reactotron-react-native": "^4.0.3",
    "typescript": "^3.8.3"
  },
  "jest": {
    "preset": "react-native"
  },
  "private": true
}

应用程序.json

{
  "name": "MyAmazingApp",
  "displayName": "MyAmazingApp",
  "expo": {
    "scheme": "MyAmazingApp-app",
    "name": "MyAmazingApp",
    "icon": "Design/MyAmazingApp_app_icon.png",
    "version": "1.0.0",
    "slug": "MyAmazingApp",
    "sdkVersion":"36.0.0",
    "orientation": "portrait",
    "androidStatusBar": {
      "backgroundColor": "#FFFFFF",
      "translucent": false
    },
    "ios": {
      "bundleIdentifier": "com.me.MyAmazingApp",
      "buildNumber": "0.0.4",
      "icon": "Design/MyAmazingApp_app_icon.png"
    },
    "android": {
      "package": "com. MyAmazingApp",
      "versionCode": 1,
      "config": {
        "googleSignIn": {
          "apiKey": "”
        },
        "googleMaps": {
          "apiKey": ""
        }
      },
      "googleServicesFile": "./google-services.json",
      "intentFilters": [
        {
          "action": "VIEW",
          "data": [
            {
              "scheme": "https",
              "host": "*.MyAmazingApp.com",
              "pathPrefix": "/restaurant/handleBarcode"
            }
          ],
          "category": [
            "BROWSABLE",
            "DEFAULT"
          ]
        }
      ]
    },
    "splash": {
      "image": "Design/MyAmazingApp_app_splash.png",
      "backgroundColor": "#FFFFFF",
      "resizeMode": "cover"
    },
    "privacy": "unlisted",
    "entryPoint": "node_modules/expo/AppEntry.js",
    "platforms": [
      "ios",
      "android",
    ],
    "notification": {
      "icon": "./Design/notification_logo.png",
      "color": "#0CD2C5",
      "androidMode": "default",
      "iosDisplayInForeground": true
    }
  }
}

标签: reactjsreact-nativeexpo

解决方案


我对我在这里看到的内容感到相当困惑 - 这似乎不是一个 expo 托管项目或 expokit 项目,但您仍在运行 expo start .. 可能值得恢复到您最后一次已知的工作提交并从那里开始


推荐阅读