{"record":{"id":"e5df1a2d061fde99","repo":"slint-ui/slint","slug":"cannot-read-err","errorCode":null,"errorMessage":"cannot read {}: {err}","messagePattern":"cannot read (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/node/build.rs","lineNumber":552,"sourceCode":"    name: String,\n    docs: Vec<String>,\n    /// Whether the variant is `#[doc(hidden)]`.\n    hidden: bool,\n    fields: Vec<RustField>,\n}\n\nstruct RustField {\n    /// `None` for a field of a tuple variant.\n    name: Option<String>,\n    js_name: Option<String>,\n    /// Last segment of the field's type path.\n    ty: String,\n    docs: Vec<String>,\n}\n\nfn parse_rust_enum(path: &std::path::Path, name: &str) -> RustEnum {\n    let source = std::fs::read_to_string(path)\n        .unwrap_or_else(|err| panic!(\"cannot read {}: {err}\", path.display()));\n    let file = syn::parse_file(&source)\n        .unwrap_or_else(|err| panic!(\"cannot parse {}: {err}\", path.display()));\n    let item = file\n        .items\n        .iter()\n        .find_map(|item| match item {\n            syn::Item::Enum(item) if item.ident == name => Some(item),\n            _ => None,\n        })\n        .unwrap_or_else(|| panic!(\"no `enum {name}` in {}\", path.display()));\n\n    RustEnum {\n        docs: doc_lines(&item.attrs),\n        attrs: item.attrs.clone(),\n        variants: item\n            .variants\n            .iter()\n            .map(|variant| RustVariant {","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/api/node/build.rs#L534-L570","documentation":"parse_rust_enum reads the Rust source file that defines the enum it must mirror into TypeScript; this panic is the read_to_string error handler. It means the build script could not open the referenced source file — a wrong path constant, a file moved/renamed upstream, or filesystem/permission trouble during the build. The input at fault is the path passed to parse_rust_enum.","triggerScenarios":"Thrown at api/node/build.rs:552 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the enum source file path passed to parse_rust_enum is correct and that the file exists in the checkout","Verify file read permissions and that no stale CARGO_MANIFEST_DIR/out-dir redirect moved the source","Re-clone or restore the missing source file; this is a build-time codegen input, not a runtime artifact"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}