无法解析模块“@sentry/react-native/expo”的插件

问题描述 投票:0回答:1

我正在通过 React Native ignite 样板使用和展示应用程序。 我想安装哨兵,我正在按照这些说明进行操作。 https://docs.expo.dev/guides/using-sentry/ 我成功运行

npx expo install @sentry/react-native
,我正在尝试添加这样的插件

 "plugins": [
  "expo-localization",
  [
    "expo-build-properties",
    {
      "ios": {
        "newArchEnabled": false
      },
      "android": {
        "newArchEnabled": false
      }
    }
  ],
  [
    "@sentry/react-native/expo",
    {
      "organization": "myslag",
      "project": "myproject"
    }
  ]
],

然后,当我尝试启动该项目时,我得到以下信息

Failed to resolve plugin for module "@sentry/react-native/expo" relative to "path to my project"
react-native expo sentry
1个回答
0
投票

我认为这与您的 Expo 版本有关。您可能需要升级到 SDK 5O 才能使用“@sentry/react-native/expo”插件。

根据文档,SDK 49及以下版本仍然使用sentry expo插件。

{
  "expo": {
    "plugins": ["sentry-expo"]
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.