Skip to content

Ember.onerror (and import of global Ember) is deprecated – all usage can probably be removed #16504

Closed

Description

@johanrd

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

  1. 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.

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 7, 2025
  2. Lms24 commented on Jun 10, 2025

    @Lms24
    Member

    Hi @johanrd I asked or resident ember expert @mydea to look into this further. Thanks for reporting!

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 10, 2025
  4. mydea commented on Jun 11, 2025

    @mydea
    Member

    This is just used to print a warning, I will just remove this! 👍

  5. github-actions commented on Jun 13, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #16547, which was included in the 9.29.0 release.

  6. johanrd commented on Jun 13, 2025

    @johanrd
    Author

    thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions