Angular 18 Support.
At this moment, we are not able to update to Angular 18 with @sentry/capacitor, because it is pinned to @sentry/[email protected], 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. https://github.com/getsentry/sentry-javascript/discussions/12377
npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @sentry/[email protected] npm ERR! Found: @angular/[email protected] 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/[email protected] 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/[email protected] 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/[email protected] 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/[email protected] 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/[email protected] npm ERR! node_modules/@angular/common npm ERR! peer @angular/common@">= 10.x <= 15.x" from @sentry/[email protected] 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/[email protected] 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.
As a temp solution, I added the following to the bottom of my package.json
"overrides": {
"@sentry/angular-ivy": {
"@angular/core": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/router": "^18.0.0"
}
}
Hey @lucas-zimerman any new on this update? Thank you ! π
Sorry for the late response, version 1.0.0-beta.1 should contain all the fixes to support angular 18
@lucas-zimerman Thanks! It seems not yet released to npm, is that process automated or does someone upload it manually?
Hi @lucas-zimerman thank you so much for your work. I just wanted to ask if you have any ETA for the release of version 1? Thanks
@lucas-zimerman any update about the release of v1 ? Thank you!
@MaximeSIMET this currently works, in package.json
"@sentry/angular": "8.9.2",
"@sentry/capacitor": "1.0.0-beta.1",
I tried already but got this issue on package import with this specific version:
TS2307: Cannot find module @sentry/capacitor or its corresponding type declarations. import * as Sentry from '@sentry/capacitor';
@MaximeSIMET this currently works, in package.json
"@sentry/angular": "8.9.2", "@sentry/capacitor": "1.0.0-beta.1",
@MaximeSIMET this currently works, in package.json
"@sentry/angular": "8.9.2", "@sentry/capacitor": "1.0.0-beta.1",
is this also recommended for angular 17? Since I am getting the same original error with Angular 17, so I thought I might use the Angular-18-version-fix