getsentry / sentry-capacitor

The official Sentry SDK for Capacitor

Home Page:https://sentry.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular 18 Support.

sebsoftpak opened this issue · comments

At this moment, we are not able to update to Angular 18 with @sentry/capacitor, because it is pinned to @sentry/angular@7.114.0, which on it's turn does not allow Angular 18.

Angular 18 seems to be supported by version 8.x of the Sentry Javascript SDK.
getsentry/sentry-javascript#12377

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @sentry/angular@7.114.0
npm ERR! Found: @angular/common@18.0.3
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"^18.0.3" from the root project
npm ERR! peer @angular/common@"18.0.3" from @angular/forms@18.0.3
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@"^18.0.3" from the root project
npm ERR! peer @angular/forms@">=16.0.0" from @ionic/angular@8.2.2
npm ERR! node_modules/@ionic/angular
npm ERR! @ionic/angular@"^8.2.2" from the root project
npm ERR! 6 more (@angular/platform-browser, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@">= 10.x <= 15.x" from @sentry/angular@7.114.0
npm ERR! node_modules/@sentry/angular
npm ERR! @sentry/angular@"7.114.0" from the root project
npm ERR! peerOptional @sentry/angular@"7.114.0" from @sentry/capacitor@0.18.0
npm ERR! node_modules/@sentry/capacitor
npm ERR! @sentry/capacitor@"^0.18.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/common@15.2.10
npm ERR! node_modules/@angular/common
npm ERR! peer @angular/common@">= 10.x <= 15.x" from @sentry/angular@7.114.0
npm ERR! node_modules/@sentry/angular
npm ERR! @sentry/angular@"7.114.0" from the root project
npm ERR! peerOptional @sentry/angular@"7.114.0" from @sentry/capacitor@0.18.0
npm ERR! node_modules/@sentry/capacitor
npm ERR! @sentry/capacitor@"^0.18.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Thank you for opening this issue!
I'll check internally what'll be the best short term solution for this issue and I'll update this issue as soon as I get a response!

While official support for Angular 18 is still in progress, you can use the following npm command to ensure compatibility with the current version of Sentry Capacitor: npm install --legacy-peer-dep. Keep in mind that this isn’t the ideal solution, but based on my tests, the latest supported version of Sentry Angular Ivy works with Angular 18. Note that Sentry JavaScript V8 has significant breaking changes, so an update for Capacitor may take some time 😊

Hi there! Has there been any updates on when this is expected to be implemented? We'd really rather not use legacy-peer-dep in our projects as this could have potential long term ramifications, especially with other packages, but as @sebsoftpak notes, this is blocking updating Angular to the latest version for anyone that will use this package.

Thanks!

@JackLazenbyZigzag in the meantime, I've uninstalled @sentry/capacitor, and changed to @sentry/angular for the time being. It's not the same ofcourse, but at least we get the Javascript errors in the meantime - and we were still able to continue upgrading all other dependencies. In our apps it was quite easy to switch between the two. And will change it back, once the new version is ready.

That's also another option if you can't wait for the new release, as @sebsoftpak suggested using @sentry/angular for the moment is another option if the --legacy-peer-dep isn't the best option (it would be great if --legacy-peer-dep could be applied to a single package but from what i saw it's not an option).

To support angular 18 we have to bump to SentryJavascript V8, that contains some big break changes, because of that it's not gonna be a fast update compared to the other bumps.

Support for V8 is currently in progress and is expected to be ready in about 2 to 3 weeks.

Sounds great, will you share a next or beta tag we can early test? Would be nice since cocoa will also fail atm without -ivy package

Sounds great, will you share a next or beta tag we can early test? Would be nice since cocoa will also fail atm without -ivy package

We will release the next release as beta.