Skip to content

Missing ErrorEvent #47587

Closed as not planned
Closed as not planned

Description

@jimmywarting

What is the problem this feature will solve?

Where trying to construct a new ErrorEvent... but it was defined.

What is the feature you are proposing to solve the problem?

A few web features can dispatch a ErrorEvent like web workers...

What alternatives have you considered?

No response

Activity

  1. bnoordhuis commented on Apr 18, 2023

    @bnoordhuis
    Member

    Node doesn't emit ErrorEvents itself so it's questionable if it makes sense to add it.

    But... without working code it won't happen in the first place. Go ahead and open a pull request and see how it's received.

  2. jimmywarting commented on Apr 18, 2023

    @jimmywarting
    Author

    As a effort into implementing spec'ed web worker (#43583) (which is highly desirable and upvoted) then the worker.onerror would have to emit a ErrorEvent.

    I notice this when i tried to build a more spec comp. web worker.

  3. jimmywarting commented on Apr 18, 2023

    @jimmywarting
    Author

    I have notice other events that Deno also has... here is a list of them: https://github.com/jimmywarting/missing-dom-events#compatibility-table

    • CloseEvent: For when a WebbSocket closes.
    • ErrorEvent: For when WebSocket fails and you also get this on globalThis.onerror

    anyway undici have both of this event builtin, maybe it could just be a mater of just exposing those on the global scope?


    There is also a desire to make globalThis inherit EventTarget in some open issue here too. so it can dispatch/emit postMessages, ErrorEvents

  4. github-actions commented on Oct 16, 2023

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

  5. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Oct 16, 2023
  6. regseb commented on Oct 19, 2023

    @regseb
    Contributor
    • CloseEvent: For when a WebbSocket closes.
    • ErrorEvent: For when WebSocket fails and you also get this on globalThis.onerror

    ErrorEvent isn't used by WebSocket. The error event of WebSocket returns a generic Event. Maybe only web workers use ErrorEvent.

    Now that WebSocket is in Node.js v21 (behind the --experimental-websocket flag), I've opened an issue #50275 to add CloseEvent in Node.js.

  7. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Oct 20, 2023
  8. github-actions commented on Apr 17, 2024

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-stale Issues and PRs exempt from automated stale handling. label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
    For more information on how the project manages feature requests, please consult the feature request management document.

  9. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Apr 17, 2024
  10. KhafraDev commented on Apr 26, 2024

    @KhafraDev
    Member

    WebSocket may use ErrorEvents, see the spec: https://html.spec.whatwg.org/multipage/indices.html#event-error

  11. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Apr 26, 2024
  12. regseb commented on Apr 26, 2024

    @regseb
    Contributor

    @KhafraDev The https://html.spec.whatwg.org/multipage/indices.html#event-error page describes the general HTML specification. The word WebSocket doesn't appear. For the error event, it indicates that the type may be Event or ErrorEvent.

    The MDN page WebSocket: error event indicates only A generic Event.

    The WebSocket specification doesn't mention ErrorEvent. For events, it doesn't specify the type of error events, whereas for the close event, it's a CloseEvent:

    • fire an event named error at the WebSocket object.
    • Fire an event named close at the WebSocket object, using CloseEvent,

    web-platform-tests only tests Event for error:

    If I run the following code in Firefox or Chromium, e is an Event variable.

    new WebSocket("ws://localhost:666").addEventListener("error", (e) => console.log(e, e.constructor.name));
  13. github-actions commented on Oct 24, 2024

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-stale Issues and PRs exempt from automated stale handling. label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
    For more information on how the project manages feature requests, please consult the feature request management document.

  14. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Oct 24, 2024
  15. github-actions commented on Nov 23, 2024

    @github-actions
    Contributor

    There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions