{"record":{"id":"ab874b297c6fd2d2","repo":"DioxusLabs/dioxus","slug":"failed-to-patch-wasm-module-at-response-faile","errorCode":null,"errorMessage":"Failed to patch wasm module at {} - response failed with: {}","messagePattern":"Failed to patch wasm module at (.+?) - response failed with: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/subsecond/subsecond/src/lib.rs","lineNumber":578,"sourceCode":"\n        let funcs: Table = wasm_bindgen::function_table().unchecked_into();\n        let memory: Memory = wasm_bindgen::memory().unchecked_into();\n        let exports: Object = wasm_bindgen::exports().unchecked_into();\n\n        let path = table.lib.to_str().unwrap();\n        if !path.ends_with(\".wasm\") {\n            return;\n        }\n\n        // Fetch + decode the patch wasm. Both awaits are pure I/O — they\n        // touch no shared state, so the future is safe to drop here.\n        let response: web_sys::Response =\n            JsFuture::from(web_sys::window().unwrap_throw().fetch_with_str(&path))\n                .await\n                .unwrap()\n                .unchecked_into();\n        if !response.ok() {\n            panic!(\n                \"Failed to patch wasm module at {} - response failed with: {}\",\n                path,\n                response.status_text()\n            );\n        }\n        let dl_bytes: ArrayBuffer = JsFuture::from(response.array_buffer().unwrap())\n            .await\n            .unwrap()\n            .unchecked_into();\n\n        // Pre-compile. This is the slow part — V8 hands it to a worker —\n        // and yields the longest. The result is a Module with no side\n        // effects on host JS state, so cancelling here is also safe.\n        let module: Module = JsFuture::from(WebAssembly::compile(dl_bytes.unchecked_ref()))\n            .await\n            .unwrap()\n            .unchecked_into();\n","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/subsecond/subsecond/src/lib.rs#L560-L596","documentation":"Subsecond's runtime hot-patcher fetched the replacement .wasm from the dev server and the HTTP response failed (non-OK status). The patch at the given library path cannot be applied without the patch module bytes, so the error reports the failing path and response.","triggerScenarios":"Thrown at packages/subsecond/subsecond/src/lib.rs:578 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The wasm patch request failed. Ensure dx serve is running and reachable, then rebuild and restart the dev server."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}