{"record":{"id":"edd44c95edaff35a","repo":"facebook/relay","slug":"expected-to-have-access-to-ast-and-docblock-source","errorCode":null,"errorMessage":"Expected to have access to AST and docblock sources.","messagePattern":"Expected to have access to AST and docblock sources\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/relay-compiler/src/build_project/build_resolvers_schema/extract_docblock_ir.rs","lineNumber":221,"sourceCode":"                    // But for fields, we may need to validate the correctness\n                    // of the @rootFragment.\n                    // And here we're reading GraphQL asts for the file,\n                    // and keeping them together with Docblock ASTs\n                    if !result.fields.is_empty() {\n                        field_asts_and_definitions.insert(\n                            file_path,\n                            (\n                                result.fields,\n                                graphql_asts.get_executable_definitions_for_file(file_path),\n                            ),\n                        );\n                    }\n                }\n                Err(err) => errors.extend(err),\n            }\n        }\n    } else {\n        panic!(\"Expected to have access to AST and docblock sources.\");\n    }\n\n    if errors.is_empty() {\n        Ok(ResolverSchemaDocuments {\n            type_asts: TypeAsts(type_asts),\n            field_asts_and_definitions: FieldAstsAndDefinitions(field_asts_and_definitions),\n        })\n    } else {\n        Err(errors)\n    }\n}\n","sourceCodeStart":203,"sourceCodeEnd":233,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/relay-compiler/src/build_project/build_resolvers_schema/extract_docblock_ir.rs#L203-L233","documentation":"extract_schema_documents_for_resolvers panics when it cannot obtain the AST and docblock sources for a project — the expected source objects are None. This is an environment/setup invariant: the compiler was asked to build a resolvers schema without the inputs it requires.","triggerScenarios":"Running extract_docblock_ir_for_project on a project where source extraction returned no AST/docblock sources (the else branch of the source lookup).","commonSituations":"Misconfigured project in relay.config (wrong src/ roots or resolver directories), unreadable/missing files, or a file watcher/partial state where sources were not collected before schema build.","solutions":["Verify the project's src root and resolver configuration in relay.config.json point at real directories","Ensure all source files under the project are readable (permissions, symlinks) and present","Clear compiler cache/state and rerun `relay-compiler`; report upstream if sources exist but extraction still returns None"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Precheck before invoking schema extraction\nif !std::path::Path::new(&project.src_root).exists() {\n    return Err(\"resolver src root missing; check relay.config.json\");\n}","typeGuard":"fn has_sources(sources: &Option<SchemaSources>) -> bool {\n    sources.is_some()\n}","tryCatchPattern":"// not catchable; ensure extraction returns Err instead of panicking when sources are None","preventionTips":["Validate relay.config.json src roots and resolver directories before running","Ensure files are readable and not removed by watchers mid-run","Fail gracefully with an Err for missing inputs rather than panicking"],"tags":["compiler","rust","panic","config","resolver-schema"],"backgroundTag":"missing-input-source","analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}