繁体   English   中英

TypeError: undefined is not an object(评估'_reactNative.Sentry.captureBreadcrumb')

[英]TypeError: undefined is not an object (evaluating '_reactNative.Sentry.captureBreadcrumb')

我已使用 react-native 版本 0.62.2 升级到 @sentry/react-native 最新版本。

我已经在使用 react-native-sentry package 和 react-native 版本 0.59.9 它工作正常。

升级后,我单独更改了导入并运行 pod install。 捆绑成功后evaluating '_reactNative.Sentry.captureBreadcrumb' 如何解决这个问题?

我的问题是,在将哨兵从 react-native-sentry 升级到 @sentry/react-native 并使用最新版本的 RN (0.62.2) 时,我是否需要一个设置向导,如此处所述yarn sentry-wizard -i reactNative -p ios android https://docs.sentry.io/platforms/react-native/#linking

同样的文档有一个部分用于从react-native-sentry升级到@sentry/react-native

https://docs.sentry.io/platforms/react-native/#upgrading-from-react-native-sentry

基本上首先你react-native unlink react-native-sentry 然后:

之后从 package.json 中删除 react-native-sentry:

npm uninstall react-native-sentry --save
# or
yarn remove react-native-sentry

完成后,只需按照文档中的描述安装@sentry/react-native ,就像它是一个新项目一样。

暂无
暂无

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

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