Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/ember
SDK Version
9.27.0
Framework Version
ember 6.5.0
Link to Sentry event
No response
Reproduction Example/SDK Setup
See current usage of global Ember import here:
|
import Ember from 'ember'; |
And usage of Ember.onerrorhere:
Steps to Reproduce
- Go here https://deprecations.emberjs.com/id/deprecate-import-onerror-from-ember and see that importing global Ember is deprecated, and that there is no replacement for Ember.onerror
The usage of Ember.onerror has been discourged for a while, and not been in the docs since Ember v5.8 (May 15, 2024)
The current docs is to simply add an event listener to the 'error' event on window:
import fetch from 'fetch';
// ...
window.addEventListener('error', function(error) {
fetch('/error-notification', {
method: 'POST',
body: JSON.stringify({
stack: error.stack,
otherInformation: 'exception message'
})
});
});
Expected Result
No imports from global Ember, specifically Ember.onerror since that is the only one used by Sentry. I guess having an event listener on the 'error' event is already handled by sentry, so the special logic for Ember.onerror can simply be removed, I think.
Actual Result
See reproduction.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/ember
SDK Version
9.27.0
Framework Version
ember 6.5.0
Link to Sentry event
No response
Reproduction Example/SDK Setup
See current usage of global Ember import here:
sentry-javascript/packages/ember/addon/index.ts
Line 15 in e040002
And usage of
Ember.onerrorhere:sentry-javascript/packages/ember/addon/index.ts
Line 57 in e040002
Steps to Reproduce
The usage of Ember.onerror has been discourged for a while, and not been in the docs since Ember v5.8 (May 15, 2024)
The current docs is to simply add an event listener to the 'error' event on window:
Expected Result
No imports from global
Ember, specificallyEmber.onerrorsince that is the only one used by Sentry. I guess having an event listener on the 'error' event is already handled by sentry, so the special logic forEmber.onerrorcan simply be removed, I think.Actual Result
See reproduction.