{"record":{"id":"c4db7f75715de3b9","repo":"DioxusLabs/dioxus","slug":"failed-to-create-output-dir","errorCode":null,"errorMessage":"failed to create output dir","messagePattern":"failed to create output dir","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/wasm-split/wasm-split-cli/src/main.rs","lineNumber":46,"sourceCode":"\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\n    // Write the js module\n    std::fs::write(\n        args.out_dir.join(\"__wasm_split.js\"),\n        emit_js(&chunks.chunks, &chunks.modules),","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/wasm-split/wasm-split-cli/src/main.rs#L28-L64","documentation":"`split` clears and recreates the output directory with `create_dir_all` and `expect`s success. This panic fires when the output directory cannot be created — permissions, path conflicts (e.g. out_dir exists as a file), or an invalid path.","triggerScenarios":"Thrown at packages/wasm-split/wasm-split-cli/src/main.rs:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the output directory path is valid and the process has permission to create it."],"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"}