Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capacitor: Add troubleshooting for Sibling SDKs #5656

Merged
25 changes: 25 additions & 0 deletions src/platforms/javascript/guides/capacitor/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,31 @@ keywords: ["minimum version", "deployment target"]
sidebar_order: 1000
---

## Different Versions for Sibling SDKs

If you see the following error during build time, the sibling SDKs installed in your app have mismatched versions:

```js
node_modules/@sentry/types/types/globals.d.ts:2:11 - error TS2451: Cannot redeclare block-scoped variable '__DEBUG_BUILD__'.
```

To avoid any issues when installing packages or using the code on another machine, you must use the same version of Sentry Capacitor and @Sentry/Angular (or any other sibling SDK) that is referenced by the peer dependency of Sentry Capacitor in your app.

Correct:

```xml
"@sentry/angular": "7.13.0",
"@sentry/capacitor": "0.10.1"
```

Incorrect:

```xml
"@sentry/angular": "^7.13.0",
"@sentry/capacitor": "^0.10.1"
```
You can check which version of the sibling SDK is installed using the following command: `npm info @sentry/capacitor peerDependencies`
lucas-zimerman marked this conversation as resolved.
Show resolved Hide resolved

## Capacitor 2 on iOS

Capacitor 3 has a minimum requirement of iOS 12.0. As a result, the Sentry SDK needs to match this requirement to support Capacitor 3. Users on older versions may run into an error similar to:
Expand Down
8 changes: 7 additions & 1 deletion src/wizard/capacitor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Install the Sentry Capacitor SDK alongside the sibling Sentry Angular SDK:
npm install --save @sentry/capacitor @sentry/angular

# yarn
yarn add @sentry/capacitor @sentry/angular @sentry/tracing
yarn add @sentry/capacitor @sentry/angular @sentry/tracing --exact
```

Or install the standalone Sentry Capacitor SDK if you don't use Ionic/Angular:
Expand All @@ -25,6 +25,12 @@ npm install --save @sentry/capacitor @sentry/tracing
yarn add @sentry/capacitor
```

<Note>

The version of the sibling SDK must match with the version referred by Sentry Capacitor. To check which version of the sibling SDK is installed, use the following command: `npm info @sentry/capacitor peerDependencies`

</Note>

## Capacitor 2 - Android Installation

<Note>
Expand Down