Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTCDataChannel error event should be of type RTCErrorEvent #1788

Open
nikwen opened this issue Aug 23, 2024 · 0 comments
Open

RTCDataChannel error event should be of type RTCErrorEvent #1788

nikwen opened this issue Aug 23, 2024 · 0 comments

Comments

@nikwen
Copy link

nikwen commented Aug 23, 2024

Code that should compile but doesn't

const peerConnection = new RTCPeerConnection();

peerConnection.addEventListener("datachannel", (event) => {
  event.channel.addEventListener("error", (event) => {
    console.error(event.error);
  });
});

TypeScript complains: "TS2339: Property error does not exist on type Event"

Reason

The RTCDataChannel error event should be of type RTCErrorEvent. In the type declarations, it's of type Error.

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant