{"record":{"id":"dd35535f36b5e32e","repo":"facebook/relay","slug":"no-schema-loaded-for-paths","errorCode":null,"errorMessage":"No schema loaded for paths: {}","messagePattern":"No schema loaded for paths: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/graphql-ir-diff/src/lib.rs","lineNumber":824,"sourceCode":"                .map(|entry| {\n                    let file_path =\n                        entry.map_err(|e| anyhow!(\"Failed to read glob entry: {}\", e))?;\n                    let file_path_str = file_path.to_string_lossy().to_string();\n                    let schema_bytes = fs::read(file_path)?;\n                    let content = String::from_utf8(schema_bytes)\n                        .map_err(|e| anyhow!(\"Cannot parse schema utf8 from bytes: {}\", e))?;\n                    Ok((content, file_path_str))\n                })\n                .collect();\n            file_entries\n        })\n        .collect::<Result<Vec<_>>>()?\n        .into_iter()\n        .flatten()\n        .collect();\n\n    if schema_files.is_empty() {\n        return Err(anyhow!(\n            \"No schema loaded for paths: {}\",\n            schema_paths.join(\",\")\n        ));\n    }\n\n    // Build a source map for DiagnosticPrinter\n    let source_map: HashMap<SourceLocationKey, TextSource> = schema_files\n        .iter()\n        .map(|(content, file_path)| {\n            let source_key = SourceLocationKey::standalone(file_path);\n            let text_source = TextSource::from_whole_document(content.clone());\n            (source_key, text_source)\n        })\n        .collect();\n\n    // Convert to (content, SourceLocationKey) tuples for build_schema_with_extensions_parallel\n    let schema_sdls: Vec<(String, SourceLocationKey)> = schema_files\n        .into_iter()","sourceCodeStart":806,"sourceCodeEnd":842,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/graphql-ir-diff/src/lib.rs#L806-L842","documentation":"load_schema aggregates all files matched by all schema_paths patterns; if the resulting schema_files list is empty, no schema was loaded at all, so it errors with the original comma-joined paths. This guards downstream schema building from an empty, meaningless input.","triggerScenarios":"Calling load_schema(vec![...]) or compare() with patterns that match zero files: wrong directory, wrong extension (e.g. '*.gsdl' instead of '*.graphql'), typo'd path, or running from a different working directory.","commonSituations":"CI checked out a partial repo missing the schema directory; relative paths resolved against an unexpected cwd; glob patterns using paths valid on one machine but not another (absolute paths, user dirs).","solutions":["Verify each glob pattern actually matches files (ls schemas/**/*.graphql or test in a shell) and fix typos/extension mismatches.","Run from the correct working directory or switch to repo-root-relative/absolute paths.","Confirm the schema files exist in CI (add a step listing them before the diff job).","Fail fast with a pre-check: call glob::glob and assert at least one match before invoking load_schema."],"exampleFix":"// before\nload_schema(vec![\"wrong_dir/*.gsdl\".to_string()])?; // matches nothing\n// after\nload_schema(vec![\"schemas/**/*.graphql\".to_string()])?;","handlingStrategy":"validation","validationCode":"fn patterns_match_files(patterns: &[String]) -> bool {\n    patterns.iter().any(|p| {\n        glob::glob(p).map(|it| it.count() > 0).unwrap_or(false)\n    })\n}\nassert!(patterns_match_files(&schema_paths), \"no schema files matched: {}\", schema_paths.join(\",\"));","typeGuard":null,"tryCatchPattern":"match load_schema(paths.clone()) {\n    Ok(s) => s,\n    Err(e) if e.to_string().starts_with(\"No schema loaded\") => {\n        anyhow::bail!(\"check schema_paths and cwd; matched nothing: {}\", paths.join(\",\"))\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Use repo-root-relative glob patterns so behavior is cwd-independent.","List matched files in CI before diff jobs.","Verify file extensions (*.graphql / *.sdl) match the patterns."],"tags":["glob","path","empty-input","configuration"],"backgroundTag":"no-files-matched","analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}