{"record":{"id":"a6f42ad49fb69230","repo":"angular/angular-cli","slug":"option-name-is-not-defined","errorCode":null,"errorMessage":"Option \"${name}\" is not defined.","messagePattern":"Option \"(.+?)\" is not defined\\.","errorType":"exception","errorClass":"OptionIsNotDefinedException","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/schematics/src/rules/template.ts","lineNumber":126,"sourceCode":"\n      if (!options.pipeSeparator) {\n        if (typeof replacement == 'function') {\n          replacement = replacement.call(data, original);\n        }\n\n        if (replacement === undefined) {\n          throw new OptionIsNotDefinedException(match);\n        }\n      } else {\n        const [name, ...pipes] = match.split(options.pipeSeparator);\n        replacement = data[name];\n\n        if (typeof replacement == 'function') {\n          replacement = replacement.call(data, original);\n        }\n\n        if (replacement === undefined) {\n          throw new OptionIsNotDefinedException(name);\n        }\n\n        replacement = pipes.reduce((acc: string, pipe: string) => {\n          if (!pipe) {\n            return acc;\n          }\n          if (!(pipe in data)) {\n            throw new UnknownPipeException(pipe);\n          }\n          const pipeFn = data[pipe];\n          if (typeof pipeFn != 'function') {\n            throw new InvalidPipeException(pipe);\n          }\n\n          // Coerce to string.\n          return '' + pipeFn(acc);\n        }, '' + replacement);\n      }","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/schematics/src/rules/template.ts#L108-L144","documentation":"Same family as error 246 but for piped placeholders: after splitting a match on options.pipeSeparator, the base name's value resolved to undefined in data, so OptionIsNotDefinedException(name) is thrown. Every piped placeholder's base name must exist in the template data.","triggerScenarios":"Path like '__name@dasherize__' with pipeSeparator '@' where data['name'] is undefined (or a function returning undefined before piping).","commonSituations":"Forgetting to pass the base option when only the piped form is used; typo in the base name inside a piped placeholder; applyTemplates called with the wrong options object.","solutions":["Ensure the base key exists in applyTemplates data, e.g. applyTemplates({ name: options.name, dasherize: string.dasherize }).","Fix the base placeholder name spelling in the template file path.","Guard the value before applying: provide fallbacks in the options object."],"exampleFix":"// before\napplyTemplates({ dasherize }) // 'name' missing\n// after\napplyTemplates({ name: options.name, dasherize })","handlingStrategy":"validation","validationCode":"const base = match.split(options.pipeSeparator!)[0];\nif (!(base in data)) {\n  throw new Error(`Base option \"${base}\" must be provided to template()`);\n}","typeGuard":"function hasBaseOption(data: Record<string, unknown>, base: string): boolean {\n  return data[base] !== undefined;\n}","tryCatchPattern":"try {\n  return mergeWith(apply(source, [template(options)]));\n} catch (err) {\n  if (err instanceof OptionIsNotDefinedException) {\n    console.error(`Provide base value for piped placeholder: ${err.message}`);\n  }\n}","preventionTips":["For every __name@pipe__ placeholder, pass both the base key and the pipe function.","Keep base names and pipe names distinct to avoid confusion.","Review template file names whenever renaming options."],"tags":["schematics","template","missing-option","pipes"],"backgroundTag":"missing-template-option","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}