{"record":{"id":"5fffa1a24346c576","repo":"OrchardCMS/OrchardCore","slug":"unknown-transport-transport","errorCode":null,"errorMessage":"Unknown transport: ${transport}.","messagePattern":"Unknown transport: (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/OrchardCore.Modules/OrchardCore.SignalR/wwwroot/Scripts/signalr.js","lineNumber":3004,"sourceCode":"        }\n        return Promise.reject(new Error(\"None of the transports supported by the client are supported by the server.\"));\n    }\n    _constructTransport(transport) {\n        switch (transport) {\n            case HttpTransportType.WebSockets:\n                if (!this._options.WebSocket) {\n                    throw new Error(\"'WebSocket' is not supported in your environment.\");\n                }\n                return new WebSocketTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent, this._options.WebSocket, this._options.headers || {});\n            case HttpTransportType.ServerSentEvents:\n                if (!this._options.EventSource) {\n                    throw new Error(\"'EventSource' is not supported in your environment.\");\n                }\n                return new ServerSentEventsTransport(this._httpClient, this._httpClient._accessToken, this._logger, this._options);\n            case HttpTransportType.LongPolling:\n                return new LongPollingTransport(this._httpClient, this._logger, this._options);\n            default:\n                throw new Error(`Unknown transport: ${transport}.`);\n        }\n    }\n    _startTransport(url, transferFormat) {\n        this.transport.onreceive = this.onreceive;\n        if (this.features.reconnect) {\n            this.transport.onclose = async (e) => {\n                let callStop = false;\n                if (this.features.reconnect) {\n                    try {\n                        this.features.disconnected();\n                        await this.transport.connect(url, transferFormat);\n                        await this.features.resend();\n                    }\n                    catch {\n                        callStop = true;\n                    }\n                }\n                else {","sourceCodeStart":2986,"sourceCodeEnd":3022,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore.Modules/OrchardCore.SignalR/wwwroot/Scripts/signalr.js#L2986-L3022","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nwithUrl(url, { transport: 7 }) // unknown combined value\n// after\nwithUrl(url, { transport: signalR.HttpTransportType.WebSockets | signalR.HttpTransportType.LongPolling })","handlingStrategy":"validation","validationCode":"const valid = [1, 2, 4]; // WebSockets, ServerSentEvents, LongPolling\nif (!valid.includes(transport) && !(transport && (transport & 7) && Number.isInteger(transport))) {\n  throw new Error('transport must be a valid HttpTransportType value');\n}","typeGuard":"const isValidTransport = (t) => Number.isInteger(t) && t >= 1 && t <= 7 && (t & 7) !== 0;","tryCatchPattern":"try {\n  await connection.start();\n} catch (e) {\n  if (String(e.message).startsWith('Unknown transport:')) {\n    console.error('Fix transport option value:', e.message);\n  }\n}","preventionTips":["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."],"tags":["signalr","javascript","transport","invalid-enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"4306c0717fe573f6fca1b4955909ddab6a192807","analyzedAt":"2026-09-13T17:41:05.024Z","contentChangedAt":"2026-09-13T17:41:05.024Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}