{"record":{"id":"9751ae09545af520","repo":"angular/angular-cli","slug":"unknown-action-action-kind","errorCode":null,"errorMessage":"Unknown action: \"${action.kind}\".","messagePattern":"Unknown action: \"(.+?)\"\\.","errorType":"exception","errorClass":"UnknownActionException","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/schematics/src/sink/sink.ts","lineNumber":116,"sourceCode":"        if (!b) {\n          this._fileDoesNotExistException(action.path);\n        }\n      }),\n    );\n  }\n\n  validateSingleAction(action: Action): Observable<void> {\n    switch (action.kind) {\n      case 'o':\n        return this._validateOverwriteAction(action);\n      case 'c':\n        return this._validateCreateAction(action);\n      case 'r':\n        return this._validateRenameAction(action);\n      case 'd':\n        return this._validateDeleteAction(action);\n      default:\n        throw new UnknownActionException(action);\n    }\n  }\n\n  commitSingleAction(action: Action): Observable<void> {\n    return concat(\n      this.validateSingleAction(action),\n      new Observable<void>((observer) => {\n        let committed: Observable<void> | null = null;\n        switch (action.kind) {\n          case 'o':\n            committed = this._overwriteFile(action.path, action.content);\n            break;\n          case 'c':\n            committed = this._createFile(action.path, action.content);\n            break;\n          case 'r':\n            committed = this._renameFile(action.path, action.to);\n            break;","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/schematics/src/sink/sink.ts#L98-L134","documentation":"UnknownActionException is thrown by Sink.validateSingleAction when an Action has a `kind` that does not map to a known one-letter kind ('c', 'o', 'r', 'd'). This indicates a corrupted, hand-constructed, or version-incompatible Action object rather than a filesystem problem.","triggerScenarios":"Passing a custom/hand-made object { kind: 'x', ... } to sink.commitSingleAction(), or deserializing actions from an incompatible schema/version where kind values changed.","commonSituations":"Custom tooling that records and replays action lists across versions of @angular-devkit/schematics; typos when constructing actions programmatically; corrupted persisted commit queues.","solutions":["Only construct actions via the official Action classes (CreateFileAction, OverwriteFileAction, RenameFileAction, DeleteFileAction).","Fix the `kind` value to one of 'c', 'o', 'r', 'd'.","Regenerate/re-record the action list with a matching version of @angular-devkit/schematics instead of replaying stale serialized actions."],"exampleFix":"// before\nsink.commitSingleAction({ kind: 'create', path, content } as any);\n// after\nimport { CreateFileAction } from '@angular-devkit/schematics/src/tree/action';\nsink.commitSingleAction(new CreateFileAction(path, content));","handlingStrategy":"validation","validationCode":"const VALID_KINDS = ['c', 'o', 'r', 'd'];\nif (!VALID_KINDS.includes(action.kind)) throw new Error(`Bad action kind: ${action.kind}`);","typeGuard":"function isValidKind(k: unknown): k is 'c' | 'o' | 'r' | 'd' {\n  return k === 'c' || k === 'o' || k === 'r' || k === 'd';\n}","tryCatchPattern":"try { sink.commitSingleAction(action); } catch (e) { if (e instanceof UnknownActionException) { logger.error(`Unrecognized action: ${JSON.stringify(action)}`); } else { throw e; } }","preventionTips":["Use the provided Action classes instead of hand-built objects","Match @angular-devkit/schematics versions between recorder and replayer","Validate serialized action lists before replay"],"tags":["schematics","unknown-action","invalid-input"],"backgroundTag":"unknown-action-kind","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}