{"record":{"id":"e81915272c8bc271","repo":"OrchardCMS/OrchardCore","slug":"no-method-defined","errorCode":null,"errorMessage":"No method defined.","messagePattern":"No method defined\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/OrchardCore.Modules/OrchardCore.SignalR/wwwroot/Scripts/signalr.js","lineNumber":606,"sourceCode":"        if (typeof AbortController === \"undefined\") {\n            // In order to ignore the dynamic require in webpack builds we need to do this magic\n            // @ts-ignore: TS doesn't know about these names\n            const requireFunc =  true ? require : 0;\n            // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide\n            this._abortControllerType = requireFunc(\"abort-controller\");\n        }\n        else {\n            this._abortControllerType = AbortController;\n        }\n    }\n    /** @inheritDoc */\n    async send(request) {\n        // Check that abort was not signaled before calling send\n        if (request.abortSignal && request.abortSignal.aborted) {\n            throw new AbortError();\n        }\n        if (!request.method) {\n            throw new Error(\"No method defined.\");\n        }\n        if (!request.url) {\n            throw new Error(\"No url defined.\");\n        }\n        const abortController = new this._abortControllerType();\n        let error;\n        // Hook our abortSignal into the abort controller\n        if (request.abortSignal) {\n            request.abortSignal.onabort = () => {\n                abortController.abort();\n                error = new AbortError();\n            };\n        }\n        // If a timeout has been passed in, setup a timeout to call abort\n        // Type needs to be any to fit window.setTimeout and NodeJS.setTimeout\n        let timeoutId = null;\n        if (request.timeout) {\n            const msTimeout = request.timeout;","sourceCodeStart":588,"sourceCodeEnd":624,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore.Modules/OrchardCore.SignalR/wwwroot/Scripts/signalr.js#L588-L624","documentation":"FetchHttpClient.send throws 'No method defined.' when the HttpRequest's method property is empty or undefined. The HTTP client requires an explicit HTTP verb on every request it dispatches. This guards against malformed internally-constructed requests.","triggerScenarios":"Invoking the low-level IHttpConnection.send(request) / HttpClient.send with a request object whose `method` field was never set; constructing an HttpRequest manually without `{ method: 'POST' }`.","commonSituations":"Custom transport or reconnect wrapper code building raw HttpRequest objects; version drift where a custom negotiate/sending layer omits method; typo like `methd` in a hand-built request object.","solutions":["Set the method explicitly: `new HttpRequest('POST', url, content)` or `request.method = 'POST'`","If using HubConnection/HttpConnection high-level APIs, let the library construct requests instead of calling send() directly","Verify any custom HttpConnection middleware preserves request.method"],"exampleFix":"// before\nconst request = new HttpRequest(undefined, 'https://host/negotiate');\nawait httpClient.send(request);\n// after\nconst request = new HttpRequest('POST', 'https://host/negotiate');\nawait httpClient.send(request);","handlingStrategy":"validation","validationCode":"if (!request || typeof request.method !== 'string' || !request.method) throw new Error('request.method required');","typeGuard":"const hasMethod = (r) => typeof r?.method === 'string' && r.method.length > 0;","tryCatchPattern":"try { await client.send(request); } catch (e) { if (e.message === 'No method defined.') { request.method = 'POST'; await client.send(request); } }","preventionTips":["Always construct HttpRequest with method first argument","Prefer high-level HubConnection APIs over raw send()","Review custom transports for dropped request fields"],"tags":["http","signalr","validation"],"backgroundTag":"missing-required-argument","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"}