{"record":{"id":"6a5dff9d9c2a19ba","repo":"leptos-rs/leptos","slug":"static-routes-are-not-currently-supported-on-wasm3","errorCode":null,"errorMessage":"Static routes are not currently supported on WASM32 server targets.","messagePattern":"Static routes are not currently supported on WASM32 server targets\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"integrations/axum/src/lib.rs","lineNumber":737,"sourceCode":"        match listing.mode() {\n            SsrMode::OutOfOrder => ooo(req),\n            SsrMode::PartiallyBlocked => pb(req),\n            SsrMode::InOrder => io(req),\n            SsrMode::Async => asyn(req),\n            SsrMode::Static(_) => {\n                #[cfg(feature = \"default\")]\n                {\n                    let regenerate = listing.regenerate.clone();\n                    handle_static_route(\n                        additional_context.clone(),\n                        app_fn.clone(),\n                        regenerate,\n                    )(state, req)\n                }\n                #[cfg(not(feature = \"default\"))]\n                {\n                    _ = state;\n                    panic!(\n                        \"Static routes are not currently supported on WASM32 \\\n                         server targets.\"\n                    );\n                }\n            }\n        }\n    }\n}\n\n/// Returns an Axum [Handler](axum::handler::Handler) that listens for a `GET` request and tries\n/// to route it using [leptos_router], serving an HTML stream of your application.\n///\n/// This version allows us to pass Axum State/Extension/Extractor or other info from Axum or network\n/// layers above Leptos itself. To use it, you'll need to write your own handler function that provides\n/// the data to leptos in a closure.\n///\n/// `replace_blocks` additionally lets you specify whether `<Suspense/>` fragments that read\n/// from blocking resources should be retrojected into the HTML that's initially served, rather","sourceCodeStart":719,"sourceCodeEnd":755,"githubUrl":"https://github.com/leptos-rs/leptos/blob/32d20f6c9d517451d77beb68d88c7716823dac41/integrations/axum/src/lib.rs#L719-L755","documentation":"Within render_route_with_context's WASM32 server target handling, static-route regeneration is only implemented when the 'default' feature is enabled; otherwise the code panics. It means you are trying to serve static routes on a wasm32 server build without the required feature, which is unsupported.","triggerScenarios":"Calling render_route (→ render_route_with_context) for a static route on a wasm32 server target compiled with #[cfg(not(feature = \"default\"))] — i.e. the default feature set was disabled.","commonSituations":"Building a wasm32-unknown-unknown server with default-features = false; custom minimal feature sets for axum integration that dropped 'default'; CI builds that prune features for size.","solutions":["Enable the crate's 'default' feature (or the specific feature it gates) for the wasm32 server build.","Avoid static routes on wasm32 server targets: use dynamic SSR routes instead.","If the wasm32 target was chosen by mistake, switch the server to a native target (e.g. x86_64/aarch64) where full support exists."],"exampleFix":"// before\naxum = { version = \"0.7\", default-features = false, features = [\"http1\"] }\n// after\nleptos_axum = { version = \"0.7\", features = [\"default\"] } // keep default features for wasm32 static routes","handlingStrategy":"validation","validationCode":"// fail fast at startup instead of at request time\n#[cfg(all(target_arch = \"wasm32\", not(feature = \"default\")))]\ncompile_error!(\"wasm32 server static routes require the 'default' feature\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable the crate's default features on wasm32 server builds.","Add a compile_error! or build.rs check for wasm32 + missing feature.","Prefer dynamic SSR routes when targeting wasm32 servers."],"tags":["wasm32","ssr","static-routes","axum","feature-flags"],"backgroundTag":"unsupported-target-feature-combination","analyzedSha":"32d20f6c9d517451d77beb68d88c7716823dac41","analyzedAt":"2026-09-01T18:55:42.580Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}