{"record":{"id":"651f6ac6f1de314b","repo":"leptos-rs/leptos","slug":"could-not-read-manifest-file","errorCode":null,"errorMessage":"could not read manifest file","messagePattern":"could not read manifest file","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"leptos/src/hydration/mod.rs","lineNumber":113,"sourceCode":"                }\n            }\n            (split, manifest)\n        } else {\n            (\n                \"__wasm_split.______________________.js\".to_string(),\n                \"__wasm_split_manifest.json\".to_string(),\n            )\n        };\n\n        let site_dir = &options.site_root;\n        let pkg_dir = &options.site_pkg_dir;\n        let path = PathBuf::from(site_dir.to_string());\n        let path = path.join(pkg_dir.to_string()).join(wasm_split_manifest);\n        let file = std::fs::read_to_string(path).ok()?;\n\n        let manifest = WasmSplitManifest(ArcStoredValue::new((\n            format!(\"{root}/{pkg_dir}\"),\n            serde_json::from_str(&file).expect(\"could not read manifest file\"),\n            wasm_split_js,\n        )));\n\n        Some(manifest)\n    }) {\n        provide_context(splits.clone());\n    }\n\n    let mut js_file_name = options.output_name.to_string();\n    let mut wasm_file_name = options.output_name.to_string();\n    if options.hash_files {\n        let hash_path = std::env::current_exe()\n            .map(|path| {\n                path.parent().map(|p| p.to_path_buf()).unwrap_or_default()\n            })\n            .unwrap_or_default()\n            .join(options.hash_file.as_ref());\n        if hash_path.exists() {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/leptos-rs/leptos/blob/32d20f6c9d517451d77beb68d88c7716823dac41/leptos/src/hydration/mod.rs#L95-L131","documentation":"When HydrationScripts finds __wasm_split_manifest.json in the package directory, it parses it with serde_json and expects success. The panic means the manifest file exists but is not valid JSON matching the expected WasmSplitManifest shape (or serde failed reading its contents).","triggerScenarios":"A corrupted, truncated, or hand-edited __wasm_split_manifest.json in the target/site pkg dir; a manifest produced by an incompatible wasm-split version that changed the JSON schema.","commonSituations":"Partial/stale build artifacts from an interrupted cargo leptos build; mixing leptos/wasm-split versions across a workspace; CI caching a pkg dir from a different build; manually editing output hashes in the manifest.","solutions":["Rebuild with cargo leptos build (clean the target/site directory first) to regenerate a valid manifest.","Verify __wasm_split_manifest.json parses as the expected JSON (object with the wasm-split entries) with jq.","Align leptos and wasm-split tool versions across all crates in the workspace.","Purge stale CI caches of target/site so an old manifest isn't reused."],"exampleFix":"// before\nrm target/site/pkg/__wasm_split_manifest.json # stale schema\n// after\ncargo clean -p app && cargo leptos build # regenerates valid manifest\n","handlingStrategy":"validation","validationCode":"let raw = std::fs::read_to_string(\"target/site/pkg/__wasm_split_manifest.json\")?;\nlet v: serde_json::Value = serde_json::from_str(&raw)?; // fails fast if corrupt\n","typeGuard":"fn valid_manifest(s: &str) -> bool {\n    serde_json::from_str::<serde_json::Value>(s).map(|v| v.is_object()).unwrap_or(false)\n}\n","tryCatchPattern":null,"preventionTips":["Clean target/site before release builds to avoid stale manifests","Pin leptos and wasm-split tool versions across the workspace","Validate the manifest JSON in CI after each build","Avoid caching target/site/pkg across different tool versions"],"tags":["leptos","hydration","json","serde"],"backgroundTag":"schema-validation-failed","analyzedSha":"32d20f6c9d517451d77beb68d88c7716823dac41","analyzedAt":"2026-09-01T18:55:42.580Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}