Skip to content

Commit

Permalink
Capacitor: Add troubleshooting for Sibling SDKs (#5656)
Browse files Browse the repository at this point in the history
* Add troubleshooting for sibling sdks

* Remove spaces

* Extra line

* Apply suggestions from code review

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* move error message to the top and extra line added

* Update src/platforms/javascript/guides/capacitor/troubleshooting.mdx

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Update src/platforms/javascript/guides/capacitor/troubleshooting.mdx

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
  • Loading branch information
lucas-zimerman and imatwawana authored Nov 18, 2022
1 parent 7db3b19 commit 9f41bdd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
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`.

## 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

1 comment on commit 9f41bdd

@vercel
Copy link

@vercel vercel bot commented on 9f41bdd Nov 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sentry-docs – ./

sentry-docs-git-master.sentry.dev
docs.sentry.io
sentry-docs.sentry.dev

Please sign in to comment.