【问题标题】:TypeError: undefined is not an object (evaluating '_reactNative.Sentry.captureBreadcrumb')TypeError: undefined is not an object (评估 '_reactNative.Sentry.captureBreadcrumb')
【发布时间】:2020-09-28 07:53:42
【问题描述】:

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

我已经在使用 react-native-sentry 包和 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 react-native-sentry


    【解决方案1】:

    同样的文档有一节用于从 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,就像它是一个新项目一样。

    【讨论】:

    • 所以在这里我不需要在升级现有向导时设置向导。那么为什么会出现评估“_reactNative.Sentry.captureBreadcrumb”错误。我已经运行了 pod install 并添加了包
    • captureBreadcrumb 在新的 SDK 中不存在。请查看新 API 的文档:docs.sentry.io/enriching-error-data/breadcrumbs/…
    猜你喜欢
    • 2021-04-09
    • 2016-09-25
    • 2021-01-06
    • 2020-06-11
    • 2021-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多