{"record":{"id":"152018cb828a2e8e","repo":"dotnet/aspnetcore","slug":"no-url-defined","errorCode":null,"errorMessage":"No url defined.","messagePattern":"No url defined\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts","lineNumber":69,"sourceCode":"            // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide\n            this._abortControllerType = requireFunc(\"abort-controller\");\n        } else {\n            this._abortControllerType = AbortController;\n        }\n    }\n\n    /** @inheritDoc */\n    public async send(request: HttpRequest): Promise<HttpResponse> {\n        // Check that abort was not signaled before calling send\n        if (request.abortSignal && request.abortSignal.aborted) {\n            throw new AbortError();\n        }\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\n        const abortController = new this._abortControllerType();\n\n        let error: any;\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\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: any = null;\n        if (request.timeout) {\n            const msTimeout = request.timeout!;","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/SignalR/clients/ts/signalr/src/FetchHttpClient.ts#L51-L87","documentation":"Thrown by FetchHttpClient.send() when request.url is falsy (undefined/empty). The fetch call needs a concrete URL, so the client rejects early. DefaultHttpClient.send also emits the same message, so it surfaces from either path. It means the HttpRequest was constructed without a URL.","triggerScenarios":"Calling httpClient.send({ method: 'POST' }) with no url; passing an empty string url; a config object whose url was conditionally undefined.","commonSituations":"Building the request from a config whose url resolved to undefined (env var missing); a custom wrapper that forgets to propagate url; calling send directly instead of the get/post helpers that take a url argument.","solutions":["Use httpClient.get(url)/.post(url, options) which require the url as the first parameter.","If calling send directly, always populate request.url.","Validate url is a non-empty string before building the request.","Check the source of the URL (env var, config) is defined at runtime."],"exampleFix":"// before\nawait httpClient.send({ method: 'POST', url: process.env.HUB_URL });\n// process.env.HUB_URL is undefined -> throws\n\n// after\nconst url = process.env.HUB_URL;\nif (!url) throw new Error('HUB_URL not configured');\nawait httpClient.post(url, { content: body });","handlingStrategy":"validation","validationCode":"function assertRequest(req: { method?: string; url?: string }) {\n  if (!req.url) throw new Error('HttpRequest.url is required');\n  if (!req.method) throw new Error('HttpRequest.method is required');\n}\nassertRequest(request);\nawait httpClient.send(request);","typeGuard":"function hasUrl(req: { url?: string }): req is { url: string } {\n  return typeof req.url === 'string' && req.url.length > 0;\n}","tryCatchPattern":"try {\n  await httpClient.send(request);\n} catch (e) {\n  if (e.message === 'No url defined.') {\n    throw new Error('Configuration missing: provide a valid hub URL');\n  }\n  throw e;\n}","preventionTips":["Resolve and validate the URL from config before building the request.","Use httpClient.get(url)/.post(url, options) which take the URL as a required parameter.","Fail fast at startup if the hub URL env var is unset."],"tags":["http-client","validation","fetch","request-building","configuration"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}