iflytek/astron-agent · error · TypeError

Cannot call a class as a function

Error message

Cannot call a class as a function

What it means

Babel-compiled _classCallCheck TypeError: a class constructor was invoked without new (i.e. called as a plain function). In this bundle it means something in the xrtc player instantiated a class incorrectly, usually due to bundler/transform interop issues.

Solutions

  1. Ensure classes are always constructed with new
  2. Check for mixed module-system interop (CJS default export vs class)
  3. Rebuild/re-pin the SDK bundle if a transform mismatch introduced this
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/xrtc-player-BJTnVhG9.js:141 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/00aaa7073e01c144. Report an issue: GitHub.

Appendix: source

Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/xrtc-player-BJTnVhG9.js:141

  return (
    (function (e) {
      if (Array.isArray(e)) return y(e);
    })(e) ||
    (function (e) {
      if ('undefined' != typeof Symbol && Symbol.iterator in Object(e))
        return Array.from(e);
    })(e) ||
    E(e) ||
    (function () {
      throw new TypeError(
        'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
      );
    })()
  );
}
function _(e, t) {
  if (!(e instanceof t))
    throw new TypeError('Cannot call a class as a function');
}
function k(e, t) {
  for (var i = 0; i < t.length; i++) {
    var r = t[i];
    ((r.enumerable = r.enumerable || !1),
      (r.configurable = !0),
      'value' in r && (r.writable = !0),
      Object.defineProperty(e, r.key, r));
  }
}
function O(e, t, i) {
  return (t && k(e.prototype, t), i && k(e, i), e);
}
function w(e) {
  var t = { exports: {} };
  return (e(t, t.exports), t.exports);
}
var A = w(function (e) {

View on GitHub (pinned to 5e758547a8)