iflytek/astron-agent · error · TypeError

Message too large (can send a maximum of MAX bytes)

Error message

Message too large (can send a maximum of MAX bytes)

What it means

A RangeError thrown by the shimmed RTCDataChannel.send when the payload length/size/byteLength exceeds the channel's negotiated MAX message size. The avatar SDK's data channel cannot carry the message; large JSON/frames sent over the signaling data channel trigger it.

Solutions

  1. Split or compress the payload so it fits under the data channel's maxMessageSize
  2. Check negotiated maxMessageSize via sctp capabilities before sending
  3. Move large payloads to HTTP and only signal via the data channel
  4. Reduce serialization size (strip base64/binary from channel messages)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/webrtc-player--YuOiwFd.js:1328 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/3c512b88f4925982. Report an issue: GitHub.

Appendix: source

Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/webrtc-player--YuOiwFd.js:1328

              ((e.RTCPeerConnection.prototype.createDataChannel = function () {
                var e = t.apply(this, arguments);
                return (r(e, this), e);
              }),
                s.wrapPeerConnectionEvent(e, 'datachannel', function (e) {
                  return (r(e.channel, e.target), e);
                }));
            }
            function r(e, t) {
              var r = e.send;
              e.send = function () {
                var n = arguments[0],
                  i = n.length || n.size || n.byteLength;
                if (
                  'open' === e.readyState &&
                  t.sctp &&
                  i > t.sctp.maxMessageSize
                )
                  throw new TypeError(
                    'Message too large (can send a maximum of ' +
                      t.sctp.maxMessageSize +
                      ' bytes)'
                  );
                return r.apply(e, arguments);
              };
            }
          }),
          (n.shimConnectionState = function (e) {
            if (
              e.RTCPeerConnection &&
              !('connectionState' in e.RTCPeerConnection.prototype)
            ) {
              var t = e.RTCPeerConnection.prototype;
              (Object.defineProperty(t, 'connectionState', {
                get: function () {
                  return (
                    { completed: 'connected', checking: 'connecting' }[

View on GitHub (pinned to 5e758547a8)