{"record":{"id":"c5b57c5473600840","repo":"angular/angular-cli","slug":"schematic-name-is-missing-fields","errorCode":null,"errorMessage":"Schematic \"${name}\" is missing fields.","messagePattern":"Schematic \"(.+?)\" is missing fields\\.","errorType":"exception","errorClass":"SchematicMissingFieldsException","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/schematics/tools/file-system-engine-host.ts","lineNumber":84,"sourceCode":"    desc: Partial<FileSystemCollectionDesc>,\n  ): FileSystemCollectionDesc {\n    if (!desc.schematics || typeof desc.schematics != 'object') {\n      throw new CollectionMissingSchematicsMapException(name);\n    }\n\n    return {\n      ...desc,\n      name,\n    } as FileSystemCollectionDesc;\n  }\n\n  protected _transformSchematicDescription(\n    name: string,\n    _collection: FileSystemCollectionDesc,\n    desc: Partial<FileSystemSchematicDesc>,\n  ): FileSystemSchematicDesc {\n    if (!desc.factoryFn || !desc.path || !desc.description) {\n      throw new SchematicMissingFieldsException(name);\n    }\n\n    return desc as FileSystemSchematicDesc;\n  }\n\n  override hasTaskExecutor(name: string): boolean {\n    if (super.hasTaskExecutor(name)) {\n      return true;\n    }\n\n    try {\n      const maybePath = require.resolve(join(this._root, name));\n      if (existsSync(maybePath)) {\n        return true;\n      }\n    } catch {}\n\n    return false;","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/schematics/tools/file-system-engine-host.ts#L66-L102","documentation":"Thrown by _transformSchematicDescription when a schematic's resolved description lacks required fields: factoryFn, path, or description. After resolving the factory reference, these three fields must all be populated for the schematic to run.","triggerScenarios":"A collection.json schematic entry missing `description` while having a factory (factoryFn and path come from resolution); or a factory module that resolves but the pipeline cannot derive path/description — `if (!desc.factoryFn || !desc.path || !desc.description)` triggers.","commonSituations":"Minimal hand-written collection.json entries that omit `description`; factory files that were moved so `path` cannot be derived; partially-filled schematic objects in custom engine subclasses calling _transformSchematicDescription with incomplete partials.","solutions":["Add a `description` field to the schematic entry in collection.json.","Verify the `factory` reference resolves to an existing file so `path` and `factoryFn` get populated.","If subclassing the host, ensure the partial description passed to _transformSchematicDescription includes factoryFn, path, and description."],"exampleFix":"// before (collection.json)\n\"my-schematic\": { \"factory\": \"./index#run\" }\n// after\n\"my-schematic\": { \"factory\": \"./index#run\", \"description\": \"Generates my thing\" }","handlingStrategy":"validation","validationCode":"const coll = JSON.parse(readFileSync('collection.json', 'utf8'));\nfor (const [name, s] of Object.entries(coll.schematics)) {\n  if (!s.factory) throw new Error(`'${name}' missing factory`);\n  if (!s.description) throw new Error(`'${name}' missing description (required by FileSystemEngineHost)`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  const schematic = collection.createSchematic(name, true);\n} catch (e) {\n  if (String(e.message).includes('is missing fields')) {\n    console.error(\"Add description (and verify factory resolves so path/factoryFn are set)\");\n  } else throw e;\n}","preventionTips":["Always include factory, description, and (when used) schema in every schematic entry.","Validate collection.json against the official JSON schema in CI.","Keep factory paths stable across refactors; add a load-all-schematics smoke test."],"tags":["schematics","configuration","missing-field"],"backgroundTag":"schematic-missing-fields","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}