<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Firefox 148: DataChannel send() fails with InvalidStateError after onopen triggers in WebRTC in Discussions</title>
    <link>https://connect.mozilla.org/t5/discussions/firefox-148-datachannel-send-fails-with-invalidstateerror-after/m-p/119543#M46789</link>
    <description>&lt;P&gt;WebRTC DataChannel worked perfectly in Firefox 147 and earlier, but after upgrading to Firefox 148, send() throws InvalidStateError immediately after onopen fires.&lt;/P&gt;&lt;P&gt;Same code works in Chrome and previous Firefox versions.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;const dataChannel = pc.createDataChannel('kvsDataChannel', { ordered: true, maxPacketLifeTime: 3000 }); dataChannel.onopen = () =&amp;gt; { console.log('open, state:', dataChannel.readyState); // Shows "open" try { dataChannel.send('hello'); // Throws InvalidStateError } catch (e) { console.error('Failed:', e.name, e.message); } };&lt;/P&gt;&lt;P&gt;Error: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable&lt;/P&gt;&lt;P&gt;Environment: Firefox 148.0 Fails OS: Windows 11 Firefox 147 and earlier Works&lt;/P&gt;&lt;P&gt;Question: What changed in Firefox 148 that broke DataChannel send()? Any workaround while this gets fixed?&lt;/P&gt;</description>
    <pubDate>Mon, 09 Mar 2026 07:56:47 GMT</pubDate>
    <dc:creator>Ethan26</dc:creator>
    <dc:date>2026-03-09T07:56:47Z</dc:date>
    <item>
      <title>Firefox 148: DataChannel send() fails with InvalidStateError after onopen triggers in WebRTC</title>
      <link>https://connect.mozilla.org/t5/discussions/firefox-148-datachannel-send-fails-with-invalidstateerror-after/m-p/119543#M46789</link>
      <description>&lt;P&gt;WebRTC DataChannel worked perfectly in Firefox 147 and earlier, but after upgrading to Firefox 148, send() throws InvalidStateError immediately after onopen fires.&lt;/P&gt;&lt;P&gt;Same code works in Chrome and previous Firefox versions.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;const dataChannel = pc.createDataChannel('kvsDataChannel', { ordered: true, maxPacketLifeTime: 3000 }); dataChannel.onopen = () =&amp;gt; { console.log('open, state:', dataChannel.readyState); // Shows "open" try { dataChannel.send('hello'); // Throws InvalidStateError } catch (e) { console.error('Failed:', e.name, e.message); } };&lt;/P&gt;&lt;P&gt;Error: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable&lt;/P&gt;&lt;P&gt;Environment: Firefox 148.0 Fails OS: Windows 11 Firefox 147 and earlier Works&lt;/P&gt;&lt;P&gt;Question: What changed in Firefox 148 that broke DataChannel send()? Any workaround while this gets fixed?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2026 07:56:47 GMT</pubDate>
      <guid>https://connect.mozilla.org/t5/discussions/firefox-148-datachannel-send-fails-with-invalidstateerror-after/m-p/119543#M46789</guid>
      <dc:creator>Ethan26</dc:creator>
      <dc:date>2026-03-09T07:56:47Z</dc:date>
    </item>
  </channel>
</rss>

