{"record":{"id":"29c178ccd303622c","repo":"DioxusLabs/dioxus","slug":"failed-to-create-new-router-after-hot-patch","errorCode":null,"errorMessage":"Failed to create new router after hot-patch!","messagePattern":"Failed to create new router after hot-patch!","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/fullstack-server/src/launch.rs","lineNumber":237,"sourceCode":"\n            // Handle just hot-patches for now.\n            // We don't do RSX hot-reload since usually the client handles that once the page is loaded.\n            //\n            // todo(jon): I *believe* SSR is resilient to RSX changes, but we should verify that...\n            Either::Right(DevserverMsg::HotReload(HotReloadMsg {\n                jump_table: Some(table),\n                for_build_id,\n                ..\n            })) if for_build_id == our_build_id => {\n                // Apply the hot-reload patch to the dioxus devtools first\n                unsafe { dioxus_devtools::subsecond::apply_patch(table).unwrap() };\n\n                // Now recreate the router\n                // We panic here because we don't want their app to continue in a maybe-corrupted state\n                make_service = hot_serve_callback\n                    .call(())\n                    .await\n                    .expect(\"Failed to create new router after hot-patch!\")\n                    .into_make_service();\n\n                // Make sure to wipe out the renderer state so we don't have stale elements\n                crate::document::reset_renderer();\n\n                _ = shutdown_tx.send(());\n            }\n\n            // Explicitly don't handle RSX hot-reloads on the server\n            // The client will handle that once the page is loaded. If we handled it here,\n            _ => {}\n        }\n    }\n}\n\nfn block_on<T>(app_future: impl Future<Output = T>) {\n    if let Ok(handle) = tokio::runtime::Handle::try_current() {\n        handle.block_on(app_future);","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/fullstack-server/src/launch.rs#L219-L255","documentation":"After applying a Subsecond hot-patch on the dev server, constructing the replacement axum Router failed. The patched code no longer satisfies the router's type/invariant expectations, so the server cannot rebuild its handler.","triggerScenarios":"Thrown at packages/fullstack-server/src/launch.rs:237 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the hot-patch output for errors; the server failed to rebuild its router after a hot patch, so verify the patched code still compiles and registers routes correctly."],"exampleFix":null,"handlingStrategy":"fallback","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-23T08:17:48.524Z"}