{"record":{"id":"d0ce2e28fb037c19","repo":"angular/angular-cli","slug":"schematic-name-is-missing-fields-d0ce2e","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/node-module-engine-host.ts","lineNumber":138,"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","sourceCodeStart":120,"sourceCodeEnd":144,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/schematics/tools/node-module-engine-host.ts#L120-L144","documentation":"Thrown by _transformSchematicDescription in packages/angular_devkit/schematics/tools/node-module-engine-host.ts:138 when a schematic entry inside a collection's schematics map is missing required fields: factoryFn (resolvable factory), path (directory of the schematic), or description. The engine validates each schematic description before registering it, via SchematicMissingFieldsException.","triggerScenarios":"A collection.json entry references a factory that fails to load (so factoryFn/path never populate), or the entry omits \"factory\"/\"description\" keys — e.g. { \"my-schematic\": {} } or an entry whose factory path doesn't resolve to a module exporting the schematic function.","commonSituations":"Typos or missing keys in hand-written collection.json; factory file not emitted by the build (factory path points to a .js that doesn't exist in dist); renamed a schematic factory but didn't update the collection entry; migrating collections between formats and dropping the \"description\" field.","solutions":["Add the missing keys to the schematic's collection.json entry: at minimum \"factory\" (resolvable path), \"description\", and ensure the engine can derive \"path\" (the schematic folder).","Verify the factory file exists in the published/built output and exports the factory function (e.g. exports function mySchematic(options): Rule).","Fix the \"factory\" path — it must resolve relative to the schematic/collection location (e.g. \"./my-schematic/index\").","Check tsconfig/build config excludes the factory file (often tsconfig excludes spec files but can also exclude generators)."],"exampleFix":"// before (collection.json entry)\n\"my-schematic\": {}\n// after\n\"my-schematic\": {\n  \"factory\": \"./my-schematic/index#mySchematic\",\n  \"description\": \"Generates a widget\",\n  \"schema\": \"./my-schematic/schema.json\"\n}","handlingStrategy":"validation","validationCode":"function validateSchematicEntries(collectionDesc) {\n  for (const [name, entry] of Object.entries(collectionDesc.schematics)) {\n    if (!entry.factory || !entry.description) {\n      throw new Error(`schematic \"${name}\" needs \"factory\" and \"description\"`);\n    }\n  }\n}","typeGuard":"function isCompleteSchematicDesc(desc) {\n  return typeof desc === 'object' && desc !== null\n    && typeof desc.factory === 'string'\n    && typeof desc.description === 'string';\n}","tryCatchPattern":"try {\n  const schematic = collection.createSchematic(name);\n} catch (err) {\n  if (err instanceof SchematicMissingFieldsException) {\n    console.error(`Schematic \"${name}\" entry in collection.json is incomplete`);\n  } else { throw err; }\n}","preventionTips":["Template every collection entry with factory, description, and schema keys from the start.","Verify the factory file is emitted to dist and exports the factory function before publishing.","Update collection.json entries whenever you rename or move a factory file.","Run a smoke test invoking each schematic from the built package in CI."],"tags":["angular","schematics","json-config","configuration"],"backgroundTag":"schematic-missing-fields","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}