{"record":{"id":"10423865856a38df","repo":"angular/angular-cli","slug":"collection-name-does-not-have-a-schematics-ma","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/file-system-engine-host.ts","lineNumber":69,"sourceCode":"  protected _resolveReferenceString(\n    refString: string,\n    parentPath: string,\n  ): { ref: RuleFactory<{}>; path: string } | null {\n    // Use the same kind of export strings as NodeModule.\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":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/schematics/tools/file-system-engine-host.ts#L51-L87","documentation":"Thrown by _transformCollectionDescription after a collection.json is loaded: the parsed JSON either has no `schematics` key or it is not an object. A valid collection must map schematic names to their descriptions.","triggerScenarios":"createCollection loads a collection.json that lacks a top-level `schematics` object (missing, null, an array, or a string).","commonSituations":"A collection.json scaffolded with only `version` or `name` fields; a JSON file that is actually a package.json by mistake; a hand-edited file where `schematics` was renamed or deleted; trailing structural changes from a bad merge.","solutions":["Add a `schematics` object to collection.json with at least one schematic entry.","Validate the JSON parses and `schematics` is a plain object (not null/array).","Confirm you are pointing the engine at collection.json, not package.json."],"exampleFix":"// before (collection.json)\n{ \"$schema\": \"...\", \"version\": \"1.0\" }\n// after\n{ \"$schema\": \"...\", \"version\": \"1.0\", \"schematics\": { \"my-schematic\": { \"factory\": \"./index#run\", \"description\": \"Runs it\" } } }","handlingStrategy":"validation","validationCode":"const coll = JSON.parse(readFileSync('collection.json', 'utf8'));\nif (!coll.schematics || typeof coll.schematics !== 'object' || Array.isArray(coll.schematics)) {\n  throw new Error('collection.json must contain a \"schematics\" object');\n}","typeGuard":"function hasSchematicsMap(c: unknown): c is { schematics: Record<string, unknown> } {\n  return typeof c === 'object' && c !== null && typeof (c as any).schematics === 'object' && (c as any).schematics !== null && !Array.isArray((c as any).schematics);\n}","tryCatchPattern":"try {\n  const collection = engine.createCollection(name);\n} catch (e) {\n  if (String(e.message).includes('does not have a schematics map')) {\n    throw new Error(`Add a \"schematics\" map to ${name}'s collection.json`);\n  }\n  throw e;\n}","preventionTips":["Start every collection.json from the official $schema and keep the schematics map present.","Validate collection.json in CI against the schematics collection JSON schema.","Never point the engine at package.json; only collection.json has the schematics map."],"tags":["schematics","configuration","schema-validation"],"backgroundTag":"missing-schematics-map","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}