React Native TypeError:无法读取未定义的js引擎的属性'source':爱马仕

ax6ht2ek  于 2022-12-14  发布在  React
关注(0)|答案(1)|浏览(175)

我最近升级到了“0.70.3”(React-Native),在IOS模拟器上运行时遇到了这个错误**TypeError:无法读取未定义的js引擎的属性'source':爱马仕
package.json

{
  "name": "juzappnoexpo",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "postinstall": "patch-package",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.15.8",
    "@react-native-community/cameraroll": "^4.0.4",
    "@react-native-community/checkbox": "^0.5.12",
    "@react-native-community/push-notification-ios": "^1.10.1",
    "@react-native-community/slider": "^4.1.7",
    "@react-native-google-signin/google-signin": "^7.0.0-alpha.3",
    "@react-navigation/bottom-tabs": "^6.0.9",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/stack": "^6.0.11",
    "@rneui/base": "^4.0.0-rc.6",
    "@rneui/themed": "^4.0.0-rc.6",
    "axios": "^0.21.1",
    "deprecated-react-native-prop-types": "^2.3.0",
    "fbjs": "^3.0.0",
    "immer": "^9.0.1",
    "lodash.remove": "^4.7.0",
    "moment": "^2.29.1",
    "patch-package": "^6.4.7",
    "react": "18.1.0",
    "react-native": "0.70.3",
    "react-native-aes-crypto": "^1.3.10",
    "react-native-audio-recorder-player": "^3.5.1",
    "react-native-camera": "git+https://git@github.com/react-native-community/react-native-camera.git",
    "react-native-contacts": "^7.0.2",
    "react-native-draggable": "^3.3.0",
    "react-native-event-source": "^1.1.0",
    "react-native-fast-image": "^8.3.7",
    "react-native-form-component": "^2.4.0",
    "react-native-fs": "^2.18.0",
    "react-native-gesture-handler": "^1.10.0",
    "react-native-image-filter-kit": "^0.8.0",
    "react-native-image-picker": "^4.1.1",
    "react-native-image-viewing": "^0.2.1",
    "react-native-incall-manager": "^3.3.0",
    "react-native-keychain": "^6.2.0",
    "react-native-loading-spinner-overlay": "^2.0.0",
    "react-native-logs": "^3.0.4",
    "react-native-paper": "^4.9.2",
    "react-native-photo-editor": "^1.0.12",
    "react-native-popup-menu": "^0.15.13",
    "react-native-push-notification": "^8.1.0",
    "react-native-remix-icon": "^0.3.0",
    "react-native-rsa-native": "^2.0.3",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^3.8.0",
    "react-native-svg": "^12.1.0",
    "react-native-user-avatar": "^1.0.7",
    "react-native-vector-icons": "^8.0.0",
    "react-native-video": "^5.2.1",
    "react-native-walkthrough-tooltip": "^1.4.0",
    "react-native-webrtc": "^1.100.1",
    "react-redux": "^7.2.2",
    "react-use-elmish": "^1.0.0",
    "redux": "^4.0.5",
    "redux-persist": "^6.0.0",
    "redux-saga": "^1.1.3",
    "rn-checkbox-list": "^1.1.0",
    "rn-fetch-blob": "^0.12.0",
    "rn-sliding-up-panel": "^2.4.5",
    "rxjs": "^6.6.3",
    "ts-assert-unreachable": "^0.0.9"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "@simbathesailor/use-what-changed": "^2.0.0",
    "@types/jest": "^26.0.20",
    "@types/react": "^17.0.1",
    "@types/react-native": "^0.63.48",
    "@types/react-native-event-source": "^1.1.0",
    "@types/react-native-incall-manager": "^3.2.1",
    "@types/react-native-loading-spinner-overlay": "^0.5.3",
    "@types/react-native-push-notification": "^7.3.3",
    "@types/react-native-video": "^5.0.8",
    "@types/react-native-webrtc": "^1.75.4",
    "@types/react-redux": "^7.1.16",
    "@types/react-test-renderer": "^17.0.0",
    "@welldone-software/why-did-you-render": "^6.2.1",
    "babel-jest": "^25.1.0",
    "eslint": "^6.5.1",
    "jest": "^25.1.0",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-native-codegen": "^0.0.8",
    "react-test-renderer": "16.13.1",
    "redux-devtools-extension": "^2.13.9",
    "redux-immutable-state-invariant": "^2.1.0",
    "remote-redux-devtools": "^0.5.16",
    "typescript": "^4.1.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

vlju58qv

vlju58qv1#

在回答这个问题的时候,你需要记住的一点是,你必须先禁用爱马仕引擎一段时间,然后才能找到解决方案。一旦你禁用了hermes引擎,你会得到一个如下所示的错误字符串:_reactNative.Image.propTypes.source .
source是未定义的propTypes的属性。
现在,您必须通过进入settings.json(USER)文件并在其中键入以下内容来启用node_modules内的搜索。
“搜索.排除”:{“**/节点模块”:false、}
保存后,在项目的VSCode全局搜索中粘贴上一步中得到的错误字符串。
_reactNative.图像.属性类型.源文件
您很可能会在react-native-slider包中找到这个字符串,它是这样显示:
源代码:_reactNative.图像.属性类型.
现在只需在顶部的任何地方声明:
如果您有任何问题,请在这里输入您的问题名称。
并将_reactNative.Image.propTypes.source替换为_reactNativeImagePropType

相关问题