iflytek/astron-agent · error · Error

onCustomSignParam.getHeader result is not an object

Error message

onCustomSignParam.getHeader result is not an object

What it means

Thrown during avatar sign-in when the app-provided onCustomSignParam.getHeader callback returns something that is not a plain object (checked via Object.prototype.toString !== '[object Object]'). The SDK merges these headers into the sign request; a function, null, or class instance triggers this.

Solutions

  1. Make getHeader return a plain object of string key/values
  2. Fix consumers whose getHeader returns Headers/functions/undefined
  3. Validate the callback's return before passing it into SDK config
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

                }
                if (
                  ((r = i.getHeader),
                  '[object Object]' !== Object.prototype.toString.call(r))
                ) {
                  t.next = 12;
                  break;
                }
                return t.abrupt(
                  'return',
                  new Headers(
                    Ei(
                      { 'Content-Type': 'application/json', appKey: e.appKey },
                      r
                    )
                  )
                );
              case 12:
                throw new Error(
                  'onCustomSignParam.getHeader result is not an object'
                );
              case 13:
                t.next = 16;
                break;
              case 15:
                throw new Error('onCustomSignParam.getHeader is not a object');
              case 16:
                t.next = 19;
                break;
              case 18:
                return t.abrupt(
                  'return',
                  new Headers({
                    'Content-Type': 'application/json',
                    appKey: e.appKey,
                    Authorization: e.authorization,
                    userId: e.userId,

View on GitHub (pinned to 5e758547a8)