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
- Use the official signalR.HttpTransportType enum values (WebSockets=1, ServerSentEvents=2, LongPolling=4) for the transport option.
- Do not bitwise-OR transport flags into an unhandled combined value; pass a supported combination only.
- Upgrade client and server SignalR packages to matching versions.
- 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
- Always reference signalR.HttpTransportType constants instead of magic numbers.
- Do not bitwise-combine transports into unmapped values.
- Keep client and server @microsoft/signalr versions aligned.
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
- Unknown value: .
- 'EventSource' is not supported in your environment.
- The ' ' argument is required.
- The ' ' argument should not be empty.
- could not find global
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)