dotnet/aspnetcore · error · Error

is not supported.

Error message

${responseType} is not supported.

What it means

deserializeContent switches on the request's responseType and explicitly rejects 'blob', 'document', and 'json' with a thrown Error. Only 'arraybuffer', 'text', and undefined/fallback are supported, because the SignalR client only needs binary and text payloads.

Solutions

  1. Use responseType 'arraybuffer' (binary) or 'text' (JSON/JSON-protocol), or omit it to default to text.
  2. If you genuinely need blob/json, implement a custom HttpClient rather than reusing FetchHttpClient with an unsupported responseType.
  3. Audit any code that builds HttpRequest literals for the SignalR client and remove responseType values other than text/arraybuffer.

Example fix

// before
const resp = await httpClient.get(url, { responseType: "json" });

// after
const resp = await httpClient.get(url, { responseType: "text" });
const data = JSON.parse(resp.content as string);
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED = new Set(["arraybuffer", "text", undefined]);
function assertResponseType(rt?: XMLHttpRequestResponseType): void {
  if (!ALLOWED.has(rt)) throw new Error(`Unsupported responseType: ${rt}`);
}

Type guard

function isSupportedResponseType(rt: unknown): rt is "arraybuffer" | "text" | undefined {
  return rt === undefined || rt === "arraybuffer" || rt === "text";
}

Try / catch

try { await httpClient.get(url, { responseType }); }
catch (e) {
  if (e instanceof Error && /is not supported/.test(e.message)) {
    return httpClient.get(url, { responseType: "text" });
  }
  throw e;
}

Prevention

When it happens

Trigger: A caller sets request.responseType to 'blob', 'document', or 'json' on an HttpRequest passed to FetchHttpClient (or to the default HttpClient.send). This is almost always user error: SignalR's transports only ever request text or arraybuffer.

Common situations: Custom HttpClient wrapper or a user that manually drives httpClient.get/post with responseType set for their own use. Misconfiguration copied from a generic fetch tutorial.

Related errors


AI-assisted analysis of dotnet/aspnetcore@3600ca084e (2026-08-11). Data as JSON: /api/errors/16450a083f6b374e. Report an issue: GitHub.

Appendix: source

Thrown at src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts:178

            this._jar.getCookies(url, (e, c) => cookies = c.join("; "));
        }
        return cookies;
    }
}

function deserializeContent(response: Response, responseType?: XMLHttpRequestResponseType): Promise<string | ArrayBuffer> {
    let content;
    switch (responseType) {
        case "arraybuffer":
            content = response.arrayBuffer();
            break;
        case "text":
            content = response.text();
            break;
        case "blob":
        case "document":
        case "json":
            throw new Error(`${responseType} is not supported.`);
        default:
            content = response.text();
            break;
    }

    return content;
}

View on GitHub (pinned to 3600ca084e)