{"record":{"id":"70c9376b9fb92f42","repo":"astral-sh/ruff","slug":"notfound-70c937","errorCode":"NotFound","errorMessage":"No such file or directory","messagePattern":"No such file or directory","errorType":"error_code","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/ty_wasm/src/lib.rs","lineNumber":1717,"sourceCode":"    fn as_writable(&self) -> Option<&dyn WritableSystem> {\n        None\n    }\n\n    fn as_any(&self) -> &dyn Any {\n        self\n    }\n\n    fn as_any_mut(&mut self) -> &mut dyn Any {\n        self\n    }\n\n    fn dyn_clone(&self) -> Box<dyn System> {\n        Box::new(self.clone())\n    }\n}\n\nfn not_found() -> std::io::Error {\n    std::io::Error::new(std::io::ErrorKind::NotFound, \"No such file or directory\")\n}\n","sourceCodeStart":1699,"sourceCodeEnd":1719,"githubUrl":"https://github.com/astral-sh/ruff/blob/d1087a4b9e03d253a88703f34e0869ee4b805456/crates/ty_wasm/src/lib.rs#L1699-L1719","documentation":"The WASM build replaces the OS with an in-memory system (WasmSystem). Reads of system paths that were never written through openFile/write_file return ErrorKind::NotFound with the conventional ENOENT message produced by the not_found() helper.","triggerScenarios":"Analysis or an explicit read touches a system path whose contents were never provided from JS: an import target that was never opened, a search-path entry with no backing files, or a stale path after reconfiguration.","commonSituations":"Forgetting to openFile a dependency before check; misconfigured searchPaths pointing at files not uploaded into the WASM instance; project settings switched to reference unavailable files.","solutions":["Open every file ty needs (openFile) or fix search paths before running checks","Pre-validate that required paths exist in the virtual FS before analysis","Treat NotFound during optional-file resolution as skippable instead of letting it abort the run"],"exampleFix":"// before\ndb.check('/project/main.py'); // imports numpy, never provided -> NotFound\n\n// after\ndb.openFile('/site-packages/numpy/__init__.py', numpySource);\ndb.check('/project/main.py');","handlingStrategy":"validation","validationCode":"// Provide required files before analysis\nconst required = ['/project/main.py', '/site-packages/dep/__init__.py'];\nfor (const [p, src] of requiredFiles) { if (!opened.has(p)) db.openFile(p, src); }","typeGuard":null,"tryCatchPattern":"try { analyze(); } catch (e) { if (String(e).includes('No such file or directory')) { /* open missing file, retry once */ } else throw e; }","preventionTips":["Open all dependency files (or configure search paths) before check()","Keep a manifest of files loaded into the virtual FS","Validate search paths exist in the virtual FS before assigning them"],"tags":["wasm","filesystem","file-not-found","module-resolution"],"backgroundTag":"file-not-found","analyzedSha":"d1087a4b9e03d253a88703f34e0869ee4b805456","analyzedAt":"2026-08-20T16:33:49.445Z","contentChangedAt":"2026-08-20T16:33:49.445Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}