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

Peer Dependencies npm install --save @Sentry/capacitor Fails #405

Closed
15aabruzzese opened this issue Jul 5, 2023 · 15 comments
Closed

Peer Dependencies npm install --save @Sentry/capacitor Fails #405

15aabruzzese opened this issue Jul 5, 2023 · 15 comments
Labels
Platform: Capacitor question Further information is requested

Comments

@15aabruzzese
Copy link

15aabruzzese commented Jul 5, 2023

Environment

Angular 16: I can successfully download @sentry/angular-ivy
Capacitor 5:
Iconic 7:
npm 9.5.1
node 18.16

Steps to Reproduce

  1. Following the installation guide for angular/capacitor set up
  2. npm install --save @sentry/capacitor @sentry/angular-ivy or npm install --save @sentry/capacitor or npm install --save @sentry/capacitor --force
  3. installation fails

image

Expected Result

The npm install would be successful

Actual Result

install fails (see screenshots)

Current Dependencies:
"dependencies": {
"@angular/common": "^16.0.3",
"@angular/core": "^16.0.3",
"@angular/forms": "^16.0.3",
"@angular/platform-browser": "^16.0.3",
"@angular/platform-browser-dynamic": "^16.0.3",
"@angular/router": "^16.0.3",
"@awesome-cordova-plugins/app-version": "^6.3.0",
"@capacitor-community/firebase-analytics": "^5.0.1",
"@capacitor/android": "^5.0.4",
"@capacitor/app": "^5.0.2",
"@capacitor/camera": "^5.0.2",
"@capacitor/core": "^5.0.5",
"@capacitor/haptics": "^5.0.2",
"@capacitor/ios": "^5.0.4",
"@capacitor/keyboard": "^5.0.2",
"@capacitor/status-bar": "^5.0.2",
"@ionic/angular": "^7.0.9",
"@ionic/pwa-elements": "^3.1.1",
"@ionic/storage-angular": "^4.0.0",
"@trapezedev/configure": "^7.0.10",
"capacitor-native-settings": "^5.0.0",
"cordova-plugin-app-version": "^0.1.14",
"envsub": "^4.1.0",
"ionicons": "^7.1.1",
"ngx-mask": "^16.0.8",
"rxjs": "^7.8.1",
"swiper": "^8.4.6",
"tslib": "^2.5.2",
"zone.js": "^0.13.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.0.3",
"@angular-eslint/builder": "^16.0.3",
"@angular-eslint/eslint-plugin": "^16.0.3",
"@angular-eslint/eslint-plugin-template": "^16.0.3",
"@angular-eslint/template-parser": "^16.0.3",
"@angular/cli": "^16.0.3",
"@angular/compiler": "*",
"@angular/compiler-cli": "^16.0.3",
"@angular/language-service": "^16.0.3",
"@capacitor/cli": "^5.0.6-nightly-20230627T150701.0",
"@ionic/angular-toolkit": "^9.0.0",
"@ionic/cli": "^7.1.1",
"@types/jasmine": "^4.3.2",
"@types/jasminewd2": "^2.0.10",
"@types/node": "^20.2.5",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
"eslint": "^8.41.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^45.0.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"jasmine-core": "^4.6.0",
"jasmine-spec-reporter": "^7.0.0",
"karma": "^6.4.2",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.0",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.0.0",
"prettier": "^2.8.8",
"protractor": "^7.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},

@lucas-zimerman
Copy link
Collaborator

Does it install with the following command?
npm install --save-exact @sentry/capacitor@0.12.1 @sentry/angular-ivy@7.56.0 --update-sentry-capacitor

@lucas-zimerman lucas-zimerman added the question Further information is requested label Jul 7, 2023
@Ionaru
Copy link

Ionaru commented Jul 9, 2023

@lucas-zimerman That results in the same error.

It looks like the @sentry/angular peer dependency of @sentry/capacitor conflicts with any Angular 16 project, even though @sentry/angular is marked as optional. Maybe related to a fix done for npm/cli#4859, but I am not sure.

image

I think the simplest fix would be to replace the peer dependency @sentry/angular with @sentry/angular-ivy in the @sentry/capacitor package.

I tried adding overrides to my package.json, but that did not work in this case. See #405 (comment)

@github-actions
Copy link
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@mdintouch
Copy link

Any plans on getting this fixed?

@15aabruzzese
Copy link
Author

Just for confirmation this has still not been resolved.

@jneterer
Copy link

Any update on this?

@ahunter135
Copy link
Contributor

Made a pr for this: #458

@afilp
Copy link

afilp commented Sep 18, 2023

@lucas-zimerman Can you please approve and merge the changes so that we can start using the fix soon (with Angular 16)? Thanks a lot!

@Ionaru
Copy link

Ionaru commented Sep 19, 2023

I was able to install this package by placing overrides in my package.json

  "overrides": {
    "@sentry/angular": {
      "@angular/common": "*",
      "@angular/core": "*",
      "@angular/router": "*"
    }
  }

@emelampianakis
Copy link

emelampianakis commented Sep 20, 2023

I was able to install this package by placing overrides in my package.json

  "overrides": {
    "@sentry/angular": {
      "@angular/common": "*",
      "@angular/core": "*",
      "@angular/router": "*"
    }
  }

Did it build with angular 16 using sentry/angular instead of /angular-ivy?

@Ionaru
Copy link

Ionaru commented Sep 21, 2023

Did it build with angular 16 using sentry/angular instead of /angular-ivy?

It builds with @sentry/angular-ivy. With those lines added to your package.json, the command npm install --save @sentry/capacitor @sentry/angular-ivy should succeed.

@krystofwoldrich
Copy link
Member

Hello everyone I've tried to reproduce the issue with a new project and I was unsuccessful.

https://github.com/krystofwoldrich/sentry-capacitor-angular-ivy/blob/64024cf710c47b523bed4a9dd5e7cc26c965c62a/package.json

Could anyone share a minimal reproducible example?

Based on the peerDependencies of sentry-capacitor the @sentry/angular package should not install automatically in projects with Angular 12 and newer.

I used this command to add Sentry npm install --save --exact @sentry/capacitor@0.12.3 @sentry/angular-ivy@7.64.0

Without specifying the version of @sentry/angular-ivy the latest gets installed which can cause issues with mismatched types with sentry-capacitor.

@Ionaru
Copy link

Ionaru commented Sep 24, 2023

I'm also no longer able to reproduce this issue, even with the original reporter's command. Maybe something was fixed on the npm side? I have since upgraded npm to v10.1.0 where before I was running version 9, I think.

For the people still running into this issue, #405 (comment) should be a viable workaround.

@krystofwoldrich
Copy link
Member

@lonaru Thanks for the message. I've tried with npm 8.19.4 and that worked.

@krystofwoldrich
Copy link
Member

Since we can't reproduce the issue I'm closing this. In case there is a new context or reproducible example, please, comment here and we can reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Capacitor question Further information is requested
Projects
Archived in project
Development

No branches or pull requests

9 participants