{"record":{"id":"54fcd0b959aa2595","repo":"DioxusLabs/dioxus","slug":"failed-to-read-input-file","errorCode":null,"errorMessage":"failed to read input file","messagePattern":"failed to read input file","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/wasm-split/wasm-split-cli/src/main.rs","lineNumber":42,"sourceCode":"    /// Validate the main module of a wasm module\n    #[clap(name = \"validate\")]\n    Validate(ValidateArgs),\n}\n\n#[derive(Parser)]\nstruct SplitArgs {\n    /// The wasm module emitted by rustc\n    original: PathBuf,\n\n    /// The wasm module emitted by wasm-bindgen\n    bindgened: PathBuf,\n\n    /// The output *directory* to write the split wasm files to\n    out_dir: PathBuf,\n}\n\nfn split(args: SplitArgs) {\n    let original = std::fs::read(&args.original).expect(\"failed to read input file\");\n    let bindgened = std::fs::read(&args.bindgened).expect(\"failed to read input file\");\n\n    _ = std::fs::remove_dir_all(&args.out_dir);\n    std::fs::create_dir_all(&args.out_dir).expect(\"failed to create output dir\");\n\n    tracing::info!(\"Building split module\");\n\n    let module = wasm_split_cli::Splitter::new(&original, &bindgened).unwrap();\n\n    let mut chunks = module.emit().unwrap();\n\n    // Write out the main module\n    tracing::info!(\n        \"Writing main module to {}\",\n        args.out_dir.join(\"main.wasm\").display()\n    );\n    std::fs::write(args.out_dir.join(\"main.wasm\"), &chunks.main.bytes).unwrap();\n","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/wasm-split/wasm-split-cli/src/main.rs#L24-L60","documentation":"`split` reads the original rustc-emitted wasm module from disk and `expect`s the read to succeed. This panic fires when the input file path is wrong, the file is missing, or it is unreadable — the failing path is the `original`/`bindgened` argument being read.","triggerScenarios":"Thrown at packages/wasm-split/wasm-split-cli/src/main.rs:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the input wasm file path exists and is readable by the wasm-split CLI."],"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"}