OrchardCMS/OrchardCore · error · Error

Unknown transport: .

Error message

Unknown transport: ${transport}.

What it means

HttpConnection's transport factory throws this when the requested/negotiated transport enum value does not match any implemented case (WebSockets, ServerSentEvents, LongPolling). It is an internal invariant guard against an unknown HttpTransportType value.

Solutions

  1. Use the official signalR.HttpTransportType enum values (WebSockets=1, ServerSentEvents=2, LongPolling=4) for the transport option.
  2. Do not bitwise-OR transport flags into an unhandled combined value; pass a supported combination only.
  3. Upgrade client and server SignalR packages to matching versions.
  4. Remove custom transport overrides and let default negotiation choose a transport.

Example fix

// before
withUrl(url, { transport: 7 }) // unknown combined value
// after
withUrl(url, { transport: signalR.HttpTransportType.WebSockets | signalR.HttpTransportType.LongPolling })
Defensive patterns

Strategy: validation

Validate before calling

const valid = [1, 2, 4]; // WebSockets, ServerSentEvents, LongPolling
if (!valid.includes(transport) && !(transport && (transport & 7) && Number.isInteger(transport))) {
  throw new Error('transport must be a valid HttpTransportType value');
}

Type guard

const isValidTransport = (t) => Number.isInteger(t) && t >= 1 && t <= 7 && (t & 7) !== 0;

Try / catch

try {
  await connection.start();
} catch (e) {
  if (String(e.message).startsWith('Unknown transport:')) {
    console.error('Fix transport option value:', e.message);
  }
}

Prevention

When it happens

Trigger: Passing an invalid transport value to withUrl options (e.g. a number not in HttpTransportType, or a combination not handled), or a corrupted negotiation result yielding an unrecognized transport flag.

Common situations: Typo or wrong constant used for the transport option; bitwise-combining transport flags in a way that yields a value outside the enum; older client/server version mismatch producing unmapped values.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13). Data as JSON: /api/errors/5fffa1a24346c576. Report an issue: GitHub.

Appendix: source

Thrown at src/OrchardCore.Modules/OrchardCore.SignalR/wwwroot/Scripts/signalr.js:3004

        }
        return Promise.reject(new Error("None of the transports supported by the client are supported by the server."));
    }
    _constructTransport(transport) {
        switch (transport) {
            case HttpTransportType.WebSockets:
                if (!this._options.WebSocket) {
                    throw new Error("'WebSocket' is not supported in your environment.");
                }
                return new WebSocketTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent, this._options.WebSocket, this._options.headers || {});
            case HttpTransportType.ServerSentEvents:
                if (!this._options.EventSource) {
                    throw new Error("'EventSource' is not supported in your environment.");
                }
                return new ServerSentEventsTransport(this._httpClient, this._httpClient._accessToken, this._logger, this._options);
            case HttpTransportType.LongPolling:
                return new LongPollingTransport(this._httpClient, this._logger, this._options);
            default:
                throw new Error(`Unknown transport: ${transport}.`);
        }
    }
    _startTransport(url, transferFormat) {
        this.transport.onreceive = this.onreceive;
        if (this.features.reconnect) {
            this.transport.onclose = async (e) => {
                let callStop = false;
                if (this.features.reconnect) {
                    try {
                        this.features.disconnected();
                        await this.transport.connect(url, transferFormat);
                        await this.features.resend();
                    }
                    catch {
                        callStop = true;
                    }
                }
                else {

View on GitHub (pinned to 4306c0717f)