{"record":{"id":"c168866f4a958965","repo":"angular/angular-cli","slug":"collection-name-does-not-have-a-schematics-ma-c16886","errorCode":null,"errorMessage":"Collection \"${name}\" does not have a schematics map.","messagePattern":"Collection \"(.+?)\" does not have a schematics map\\.","errorType":"exception","errorClass":"CollectionMissingSchematicsMapException","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/schematics/tools/node-module-engine-host.ts","lineNumber":123,"sourceCode":"  protected _resolveReferenceString(\n    refString: string,\n    parentPath: string,\n    collectionDescription?: FileSystemCollectionDesc,\n  ): { ref: RuleFactory<{}>; path: string } | null {\n    const ref = new ExportStringRef<RuleFactory<{}>>(refString, parentPath);\n    if (!ref.ref) {\n      return null;\n    }\n\n    return { ref: ref.ref, path: ref.module };\n  }\n\n  protected _transformCollectionDescription(\n    name: string,\n    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;","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/schematics/tools/node-module-engine-host.ts#L105-L141","documentation":"Thrown by _transformCollectionDescription in packages/angular_devkit/schematics/tools/node-module-engine-host.ts:123 when the loaded collection description has no \"schematics\" property or that property is not an object. A collection JSON file must contain a schematics map (schematic name -> description) for the engine to expose any schematics; this guard rejects malformed collection files via CollectionMissingSchematicsMapException.","triggerScenarios":"Loading a collection JSON whose top-level object is missing \"schematics\" or has it set to a string/array/null — e.g. the package's \"schematics\" field in package.json points to a JSON file that only contains metadata, or an empty `{}` collection file, or a hand-edited collection.json that dropped the schematics key.","commonSituations":"Pointing package.json's \"schematics\" field at the wrong JSON file (e.g. a schema file instead of the collection file); publishing a collection file truncated/emptied by a build step; typos like \"schematic\" or \"schemas\" as the top-level key; upgrading a schematics package whose collection format changed.","solutions":["Open the collection JSON referenced by the package's \"schematics\" field and add a top-level \"schematics\": { ... } object mapping schematic names to their descriptions.","Confirm the \"schematics\" field in package.json points to the collection.json, not to a schema.json or tsconfig-style file.","Check the build/publish pipeline isn't overwriting or emptying the collection file (e.g. copying the wrong file into dist).","Reinstall/upgrade the package in case your local copy is stale or corrupted."],"exampleFix":"// before (collection.json)\n{\n  \"schematic\": {\n    \"my-schematic\": { \"factory\": \"./my-schematic\" }\n  }\n}\n// after\n{\n  \"schematics\": {\n    \"my-schematic\": { \"factory\": \"./my-schematic\", \"description\": \"Generates a thing\" }\n  }\n}","handlingStrategy":"validation","validationCode":"function validateCollectionJson(collectionJson) {\n  const desc = JSON.parse(collectionJson);\n  if (!desc.schematics || typeof desc.schematics !== 'object' || Array.isArray(desc.schematics)) {\n    throw new Error('collection JSON must have a top-level \"schematics\" object');\n  }\n  return desc;\n}","typeGuard":"function hasSchematicsMap(desc) {\n  return typeof desc === 'object' && desc !== null\n    && typeof desc.schematics === 'object' && desc.schematics !== null\n    && !Array.isArray(desc.schematics);\n}","tryCatchPattern":"try {\n  const collection = engine.createCollection(name);\n} catch (err) {\n  if (err instanceof CollectionMissingSchematicsMapException) {\n    console.error(`Collection \"${name}\" JSON lacks a \"schematics\" map; fix collection.json`);\n  } else { throw err; }\n}","preventionTips":["Validate collection.json against the @angular-devkit/schematics collection schema in CI.","Never hand-edit collection.json without re-checking that the top-level \"schematics\" key survives.","Keep package.json's \"schematics\" field pointing at the actual collection file, verified in a pre-publish script.","Ensure build steps copy collection.json unchanged into dist."],"tags":["angular","schematics","json-config","configuration"],"backgroundTag":"collection-missing-schematics-map","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}