iflytek/astron-agent · error · TypeError
Argument 1 of RTCPeerConnection.removeTrack does not…
Error message
Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.
What it means
A TypeError raised by the browser's native removeTrack binding when the argument is not an RTCRtpSender — typically null/undefined because getSender() returned nothing or the track was never added. The shim calls removeTrack with an invalid sender after checking _isClosed.
Solutions
- Only call removeTrack with a sender obtained from addTrack/addTransceiver return values
- Guard for null/undefined sender before calling removeTrack
- Verify the track/stream was actually added on this PeerConnection
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/webrtc-player--YuOiwFd.js:2916 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/1750b63e6b33d250.
Report an issue: GitHub.
Appendix: source
Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/webrtc-player--YuOiwFd.js:2916
(e.getTracks().forEach(function (e, t) {
var r = n.getTracks()[t];
e.addEventListener('enabled', function (e) {
r.enabled = e.enabled;
});
}),
n.getTracks().forEach(function (e) {
r.addTrack(e, n);
}));
}
}),
(p.prototype.removeTrack = function (t) {
if (this._isClosed)
throw c(
'InvalidStateError',
'Attempted to call removeTrack on a closed peerconnection.'
);
if (!(t instanceof e.RTCRtpSender))
throw new TypeError(
'Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.'
);
var r = this.transceivers.find(function (e) {
return e.rtpSender === t;
});
if (!r)
throw c(
'InvalidAccessError',
'Sender was not created by this connection.'
);
var n = r.stream;
(r.rtpSender.stop(),
(r.rtpSender = null),
(r.track = null),
(r.stream = null),
-1 ===
this.transceivers
.map(function (e) {View on GitHub (pinned to 5e758547a8)