繁体   English   中英

react-native-in-app-notification 错误类型错误:未定义不是 object(评估“_reactNative.Image.propTypes.source”)

[英]react-native-in-app-notification ERROR TypeError: undefined is not an object (evaluating '_reactNative.Image.propTypes.source')

我正在使用 React Native Expo 的最新版本 SDK。在使用react-native-in-app-notification package 时,出现以下错误,

 ERROR  TypeError: undefined is not an object (evaluating '_reactNative.Image.propTypes.source')
 ERROR  Invariant Violation: Failed to call into JavaScript module method AppRegistry.unmountApplicationComponentAtRootTag(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
        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 e ERROR  Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered 
callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerform        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.

请帮我...

proptTypes已从react-native中删除,这导致未维护的包出现这些问题。 您可以分叉该回购然后应用更改并使用您的分叉回购或按照以下方法在 package 中修复patch-package

  1. 打开node_modules/react-native-in-app-notification
  2. 将更改应用于此 PR 中提到的相应文件: 解决类型错误
  3. 从项目的根目录运行npm i patch-package ( patch-package )
  4. 运行npx patch-package react-native-in-app-notification (这将创建一个补丁文件,其中包含包的 node_modules 文件中的更改)
  5. 在 package.json 中的scripts下添加"postinstall": "patch-package"以在package.json npm install后自动运行patch-package并应用更改

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM