{"record":{"id":"97d9ed5eb1fca40f","repo":"zed-industries/zed","slug":"failed-to-create-fetch-request-error","errorCode":null,"errorMessage":"failed to create fetch Request: {error:?}","messagePattern":"failed to create fetch Request: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_web/src/http_client.rs","lineNumber":136,"sourceCode":"    if let Some(redirect_policy) = parts.extensions.get::<RedirectPolicy>() {\n        match redirect_policy {\n            RedirectPolicy::NoFollow => {\n                init.set_redirect(web_sys::RequestRedirect::Manual);\n            }\n            RedirectPolicy::FollowLimit(_) | RedirectPolicy::FollowAll => {\n                init.set_redirect(web_sys::RequestRedirect::Follow);\n            }\n        }\n    }\n\n    if let Some(ref bytes) = body_bytes {\n        let uint8array = js_sys::Uint8Array::from(bytes.as_slice());\n        init.set_body(uint8array.as_ref());\n    }\n\n    let url = parts.uri.to_string();\n    let request = web_sys::Request::new_with_str_and_init(&url, &init)\n        .map_err(|error| anyhow!(\"failed to create fetch Request: {error:?}\"))?;\n\n    let request_headers = request.headers();\n    for (name, value) in &parts.headers {\n        let value_str = value\n            .to_str()\n            .map_err(|_| anyhow!(\"non-ASCII header value for {name}\"))?;\n        request_headers\n            .set(name.as_str(), value_str)\n            .map_err(|error| anyhow!(\"failed to set header {name}: {error:?}\"))?;\n    }\n\n    let promise =\n        global_fetch(&request).map_err(|error| anyhow!(\"fetch threw an error: {error:?}\"))?;\n    let response_value = wasm_bindgen_futures::JsFuture::from(promise)\n        .await\n        .map_err(|error| anyhow!(\"fetch failed: {error:?}\"))?;\n\n    let web_response: web_sys::Response = response_value","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_web/src/http_client.rs#L118-L154","documentation":"Guard in the wasm HTTP client's fetch: constructing the web_sys::Request from the URL string and RequestInit failed, i.e. the browser rejected the request before any network I/O. {error:?} is a JS TypeError, typically an unparseable URL/relative URL in a non-window context or an invalid body/init combination.","triggerScenarios":"Thrown at crates/gpui_web/src/http_client.rs:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the request URI is an absolute, valid URL before building the Request","Check that body/init combination is legal for fetch (e.g. body with GET is rejected)","Log the JS error and reject the caller's response future with a clear bad-request message"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}