getsentry / sentry-capacitor

The official Sentry SDK for Capacitor

Home Page:https://sentry.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependency issue with latest Ionic Angular release

mleusink-ps opened this issue · comments

Hi all,

I have used Ionic + Capacitor for years but this is my first time attempting to use Sentry so I apologize in advance if I'm missing anything obvious.

Environment

Windows 10
nvm-windows: 1.1.12
node.js: 20.14.0
npm: 10.7.0
@ionic/cli: 7.2.0
@sentry/capacitor: Installation of latest version fails; see error list below

Steps to Reproduce

Quick summary:
Starting from a fresh installation of the latest Node.JS LTS, I installed only the latest Ionic CLI (no other packages). I then created a new blank Ionic project using the Angular framework. In that project folder I tried installing @sentry/capacitor and @sentry/angular following the Sentry.IO docs. This is about as clean an installation as I can imagine so I'm not sure what I could be doing wrong.

Detailed steps to reproduce:

  1. Install latest nvm-windows (1.1.12)
  2. Install latest LTS version of node.js: nvm install 20.14.0
  3. Install latest Ionic version: npm install -g @ionic/cli
  4. Start a new Ionic project: ionic start
  5. When asked about using the app creation wizard, select 'No'
  6. When asked which framework to use, select Angular
  7. When asked for a project name, enter 'sentry-test'
  8. When asked which starter template to use, select 'blank'
  9. When asked about using NgModules or Standalone, choose NgModules
  10. When asked about creating a free Ionic account, select 'No'
  11. Navigate to the newly created project folder
  12. Try to install sentry: npm install --save @sentry/capacitor @sentry/angular

Expected Result

Sentry installs as outlined in the documentation.

Actual Result

Sentry fails to install with the following dependency errors:
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @sentry/angular@7.114.0
npm error Found: @angular/common@18.0.2
npm error node_modules/@angular/common
npm error peer @angular/common@"18.0.2" from @angular/forms@18.0.2
npm error node_modules/@angular/forms
npm error peer @angular/forms@">=16.0.0" from @ionic/angular@8.2.1
npm error node_modules/@ionic/angular
npm error @ionic/angular@"^8.0.0" from the root project
npm error @angular/forms@"^18.0.0" from the root project
npm error peer @angular/common@"18.0.2" from @angular/platform-browser@18.0.2
npm error node_modules/@angular/platform-browser
npm error peer @angular/platform-browser@"18.0.2" from @angular/forms@18.0.2
npm error node_modules/@angular/forms
npm error peer @angular/forms@">=16.0.0" from @ionic/angular@8.2.1
npm error node_modules/@ionic/angular
npm error @ionic/angular@"^8.0.0" from the root project
npm error 1 more (the root project)
npm error peer @angular/platform-browser@"18.0.2" from @angular/platform-browser-dynamic@18.0.2
npm error node_modules/@angular/platform-browser-dynamic
npm error @angular/platform-browser-dynamic@"^18.0.0" from the root project
npm error 2 more (@angular/router, the root project)
npm error 3 more (@angular/platform-browser-dynamic, @angular/router, the root project)
npm error
npm error Could not resolve dependency:
npm error peer @angular/common@">= 10.x <= 15.x" from @sentry/angular@7.114.0
npm error node_modules/@sentry/angular
npm error @sentry/angular@"" from the root project
npm error peerOptional @sentry/angular@"7.114.0" from @sentry/capacitor@0.18.0
npm error node_modules/@sentry/capacitor
npm error @sentry/capacitor@"
" from the root project
npm error
npm error Conflicting peer dependency: @angular/common@15.2.10
npm error node_modules/@angular/common
npm error peer @angular/common@">= 10.x <= 15.x" from @sentry/angular@7.114.0
npm error node_modules/@sentry/angular
npm error @sentry/angular@"" from the root project
npm error peerOptional @sentry/angular@"7.114.0" from @sentry/capacitor@0.18.0
npm error node_modules/@sentry/capacitor
npm error @sentry/capacitor@"
" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

In case it helps, here is the result of 'npm list' inside my blank Ionic project. The only package that I installed is @ionic/cli. All other packages were installed automatically when Ionic created the blank project. Ionic does not provide any way to pick which package versions are used so I'm stuck with these versions.
+-- @angular-devkit/build-angular@18.0.3
+-- @angular-eslint/builder@18.0.1
+-- @angular-eslint/eslint-plugin-template@18.0.1
+-- @angular-eslint/eslint-plugin@18.0.1
+-- @angular-eslint/schematics@18.0.1
+-- @angular-eslint/template-parser@18.0.1
+-- @angular/animations@18.0.2
+-- @angular/cli@18.0.3
+-- @angular/common@18.0.2
+-- @angular/compiler-cli@18.0.2
+-- @angular/compiler@18.0.2
+-- @angular/core@18.0.2
+-- @angular/forms@18.0.2
+-- @angular/language-service@18.0.2
+-- @angular/platform-browser-dynamic@18.0.2
+-- @angular/platform-browser@18.0.2
+-- @angular/router@18.0.2
+-- @capacitor/app@6.0.0
+-- @capacitor/cli@6.1.0
+-- @capacitor/core@6.1.0
+-- @capacitor/haptics@6.0.0
+-- @capacitor/keyboard@6.0.0
+-- @capacitor/status-bar@6.0.0
+-- @ionic/angular-toolkit@11.0.1
+-- @ionic/angular@8.2.1
+-- @types/jasmine@5.1.4
+-- @typescript-eslint/eslint-plugin@6.21.0
+-- @typescript-eslint/parser@6.21.0
+-- eslint-plugin-import@2.29.1
+-- eslint-plugin-jsdoc@48.2.9
+-- eslint-plugin-prefer-arrow@1.2.2
+-- eslint@8.57.0
+-- ionicons@7.4.0
+-- jasmine-core@5.1.2
+-- jasmine-spec-reporter@5.0.2
+-- karma-chrome-launcher@3.2.0
+-- karma-coverage@2.2.1
+-- karma-jasmine-html-reporter@2.1.0
+-- karma-jasmine@5.1.0
+-- karma@6.4.3
+-- rxjs@7.8.1
+-- tslib@2.6.3
+-- typescript@5.4.5
`-- zone.js@0.14.7

Any help would be appreciated. Thanks in advance!

Hey for the time being Angular 18 is not supported, I'll check with the internal team what's the best solution for this case, sorry for that :/

In regard to this conversation, lets keep this conversation on this issue to avoid duplicated issues #671