{"record":{"id":"a528333c37d52705","repo":"leptos-rs/leptos","slug":"you-are-rendering-anyview-to-html-without-the-ssr","errorCode":null,"errorMessage":"You are rendering AnyView to HTML without the `ssr` feature enabled.","messagePattern":"You are rendering AnyView to HTML without the `ssr` feature enabled\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tachys/src/view/any_view.rs","lineNumber":431,"sourceCode":"    {\n        AnyViewWithAttrs {\n            view: self,\n            attrs: vec![attr.into_cloneable_owned().into_any_attr()],\n        }\n    }\n}\n\nimpl RenderHtml for AnyView {\n    type AsyncOutput = Self;\n    type Owned = Self;\n\n    fn dry_resolve(&mut self) {\n        #[cfg(feature = \"ssr\")]\n        {\n            (self.dry_resolve)(&mut self.value)\n        }\n        #[cfg(not(feature = \"ssr\"))]\n        panic!(\n            \"You are rendering AnyView to HTML without the `ssr` feature \\\n             enabled.\"\n        );\n    }\n\n    async fn resolve(self) -> Self::AsyncOutput {\n        #[cfg(feature = \"ssr\")]\n        {\n            (self.resolve)(self.value).await\n        }\n        #[cfg(not(feature = \"ssr\"))]\n        panic!(\n            \"You are rendering AnyView to HTML without the `ssr` feature \\\n             enabled.\"\n        );\n    }\n\n    const MIN_LENGTH: usize = 0;","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/leptos-rs/leptos/blob/32d20f6c9d517451d77beb68d88c7716823dac41/tachys/src/view/any_view.rs#L413-L449","documentation":"AnyView's dry_resolve (used in server-side rendering dry runs to determine view type/branch info) delegates to an SSR-only function pointer. Without the `ssr` feature enabled, there is no implementation, so the method panics rather than silently producing wrong HTML.","triggerScenarios":"Calling dry_resolve on an AnyView (e.g. during SSR or resolve-to-HTML paths) in a build compiled without the `ssr` feature on tachys/leptos.","commonSituations":"Rendering to string on the server but the crate was built with only the csr/hydrate features; using the same binary for client and server without cfg-split features; missing `island`/`ssr` feature toggles in Cargo.toml.","solutions":["Enable the `ssr` feature on leptos/tachys for the server build (cargo build --features ssr).","Split server and client into separate binaries/targets with the appropriate feature flags (leptos' standard project layout).","Avoid resolving AnyView to HTML in client-only builds."],"exampleFix":"// before (Cargo.toml, server)\nleptos = { version = \"0.7\", features = [\"csr\"] }\n// after\nleptos = { version = \"0.7\", features = [\"ssr\"] }","handlingStrategy":"validation","validationCode":"#[cfg(not(feature = \"ssr\"))]\ncompile_error!(\"HTML string rendering requires the `ssr` feature\"); // in server crate","typeGuard":null,"tryCatchPattern":"std::panic::catch_unwind(|| any_view.dry_resolve()); // surface a feature-flag error message instead of a raw panic","preventionTips":["Enable the ssr feature on every server-rendering binary.","Keep server and client features in separate crate targets.","CI-check that the server build reports leptos/tachys with ssr."],"tags":["ssr","feature-flags","anyview"],"backgroundTag":"missing-ssr-feature","analyzedSha":"32d20f6c9d517451d77beb68d88c7716823dac41","analyzedAt":"2026-09-01T18:55:42.580Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}