Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox 148: DataChannel send() fails with InvalidStateError after onopen triggers

  • Gan freagra
  • 0 leis an bhfadhb seo
  • 47 views

WebRTC DataChannel worked perfectly in Firefox 147 and earlier, but after upgrading to Firefox 148, send() throws InvalidStateError immediately after onopen fires. Same code works in Chrome and previous Firefox versions.

const dataChannel = pc.createDataChannel('kvsDataChannel', {

   ordered: true,
   maxPacketLifeTime: 3000

});

dataChannel.onopen = () => {

   console.log('open, state:', dataChannel.readyState); // Shows "open"
   try {
       dataChannel.send('hello'); // Throws InvalidStateError
   } catch (e) {
       console.error('Failed:', e.name, e.message);
   }

};

Error: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable

Environment: Firefox 148.0: Fails OS: Windows 11 Firefox 147 and earlier: Works

Question: What changed in Firefox 148 that broke DataChannel send()? Any workaround while this gets fixed?

WebRTC DataChannel worked perfectly in Firefox 147 and earlier, but after upgrading to Firefox 148, send() throws InvalidStateError immediately after onopen fires. Same code works in Chrome and previous Firefox versions. ''const dataChannel = pc.createDataChannel('kvsDataChannel', { ordered: true, maxPacketLifeTime: 3000 }); dataChannel.onopen = () => { console.log('open, state:', dataChannel.readyState); // Shows "open" try { dataChannel.send('hello'); // Throws InvalidStateError } catch (e) { console.error('Failed:', e.name, e.message); } };'' '''Error''': InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable '''Environment''': Firefox 148.0: Fails OS: Windows 11 Firefox 147 and earlier: Works '''Question''': What changed in Firefox 148 that broke DataChannel send()? Any workaround while this gets fixed?

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.