{"record":{"id":"899a879138790405","repo":"tailwindlabs/tailwindcss","slug":"unsupported-platform","errorCode":null,"errorMessage":"unsupported platform","messagePattern":"unsupported platform","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/ignore/src/walk.rs","lineNumber":391,"sourceCode":"\n        Ok(DirEntryRaw {\n            path: ent.path(),\n            ty,\n            follow_link: false,\n            depth,\n            ino: ent.ino(),\n        })\n    }\n\n    // Placeholder implementation to allow compiling on non-standard platforms\n    // (e.g. wasm32).\n    #[cfg(not(any(windows, unix)))]\n    fn from_entry_os(\n        depth: usize,\n        ent: &fs::DirEntry,\n        ty: fs::FileType,\n    ) -> Result<DirEntryRaw, Error> {\n        Err(Error::Io(io::Error::new(\n            io::ErrorKind::Other,\n            \"unsupported platform\",\n        )))\n    }\n\n    #[cfg(windows)]\n    fn from_path(depth: usize, pb: PathBuf, link: bool) -> Result<DirEntryRaw, Error> {\n        let md = fs::metadata(&pb).map_err(|err| Error::Io(err).with_path(&pb))?;\n        Ok(DirEntryRaw {\n            path: pb,\n            ty: md.file_type(),\n            follow_link: link,\n            depth,\n            metadata: md,\n        })\n    }\n\n    #[cfg(unix)]","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/tailwindlabs/tailwindcss/blob/16e94cbf7f965c5ad697e90e940b5e178efad67c/crates/ignore/src/walk.rs#L373-L409","documentation":"Returned by DirEntryRaw::from_entry_os() when compiled for a target that is neither windows nor unix (guarded by #[cfg(not(any(windows, unix)))]). It is a placeholder so the crate compiles on e.g. wasm32, but directory-entry construction from a fs::DirEntry always fails there. This is an intentional 'unsupported on this platform' stub.","triggerScenarios":"Building and running the ignore crate on wasm32-unknown-unknown (or any non-windows/non-unix target) and attempting to walk a real directory via from_entry_os. The function exists only to satisfy type checking; it always errors.","commonSituations":"Compiling a tool that depends on ignore into a WASM module and then calling directory-walk APIs. Targeting an embedded/no_std-adjacent platform without unix/windows features.","solutions":["Target a platform with real filesystem support (unix or windows) if you need directory walking.","On wasm, use the wasm32-wasi target (which provides unix-like syscalls) instead of wasm32-unknown-unknown.","Avoid calling directory-walk entry construction on platforms gated out by cfg."],"exampleFix":"// before — builds on wasm32-unknown-unknown, errors at runtime\nlet entry = DirEntryRaw::from_entry_os(depth, &dir_entry, ft)?;\n\n// after — target wasm32-wasi or a unix/windows target\n// cargo build --target wasm32-wasi","handlingStrategy":"validation","validationCode":"// Build-time guard\n#[cfg(not(any(windows, unix)))]\ncompile_error!(\"directory walking is unsupported on this target\");","typeGuard":null,"tryCatchPattern":"let entry = DirEntryRaw::from_entry_os(depth, &de, ft)\n    .map_err(|_| std::io::Error::new(std::io::ErrorKind::Unsupported, \"dir walk unavailable\"))?;","preventionTips":["Target wasm32-wasi or a unix/windows platform for filesystem access.","Gate directory-walk code behind #[cfg(any(windows, unix))].","Provide a no-op alternative for unsupported targets."],"tags":["ignore","rust","platform","wasm","walkdir"],"backgroundTag":null,"analyzedSha":"16e94cbf7f965c5ad697e90e940b5e178efad67c","analyzedAt":"2026-08-12T06:02:42.469Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}