fix(angular-ivy): Adjust package entry points to support Angular 17 with SSR config #9412
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adjusts the entry points of
@sentry/angular-ivy
'spackage.json
to point directly to FESM2015 bundles (= bundled ESM2015 code) instead of the UMD bundles. This fixes an error when the old (no longer supported) UMD bundles were picked up by Vite in Angular apps with SSR config (#9376).This workaround was suggested by an Angular Team member and after experimenting with it, I found out that in addition to removing the
main
entry point, we also need to add"type": "module"
.Tested this with Angular 17 + Node 18 as well as Angular 12 with Node 12. Both seem to work in my test apps. I'm not 100% confident that this always works because we're no longer APF12-compliant. However we'll go with this for now and revisit if we get reports.
A proper long term fix to this is to bump to Angular 15 in this package which we can only do in a new major.
closes #9376