{"record":{"id":"d66e8f0af4767fc1","repo":"handlebars-lang/handlebars.js","slug":"missing-helper-name","errorCode":null,"errorMessage":"Missing helper: \"${name}\"","messagePattern":"Missing helper: \"(.+?)\"","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"lib/handlebars/helpers/helper-missing.js","lineNumber":10,"sourceCode":"import { Exception } from '@handlebars/parser';\n\nexport default function (instance) {\n  instance.registerHelper('helperMissing', function (/* [args, ]options */) {\n    if (arguments.length === 1) {\n      // A missing field in a {{foo}} construct.\n      return undefined;\n    } else {\n      // Someone is actually trying to call something, blow up.\n      throw new Exception(\n        'Missing helper: \"' + arguments[arguments.length - 1].name + '\"'\n      );\n    }\n  });\n}\n","sourceCodeStart":1,"sourceCodeEnd":16,"githubUrl":"https://github.com/handlebars-lang/handlebars.js/blob/13a7a679910d2adbfe7f6fad61ce8f98426b0378/lib/handlebars/helpers/helper-missing.js#L1-L16","documentation":"This is thrown by Handlebars' built-in 'helperMissing' helper. When a template references an identifier as a function call (e.g. {{foo bar}}) and no helper named 'foo' is registered, Handlebars calls helperMissing; if there is more than just the options argument (meaning it looked like a helper invocation with args), it throws 'Missing helper: \"foo\"'. A plain {{foo}} with a missing field returns undefined instead.","triggerScenarios":"Template contains {{someHelper arg}} or {{#someHelper}} but no helper named 'someHelper' is registered; typo in a helper name; helper registered on a different Handlebars instance than the one compiling the template; helper removed/renamed after a version upgrade; invoking a block helper without block params after strict-mode-ish misuse.","commonSituations":"Upgrading Handlebars where a built-in helper moved (e.g. after splitting packages); forgetting instance.registerHelper when using multiple instances; typos like {{#ech}} instead of {{#each}}; partials compiled with a different instance than the one holding the helpers.","solutions":["Register the missing helper before compiling: instance.registerHelper('name', fn), or use the global Handlebars.registerHelper if using the default instance.","Fix the typo in the template so it matches a registered helper or an existing data field.","Ensure the same Handlebars instance is used for registerHelper and for compile/template execution.","Check the changelog when upgrading: built-in helpers (each, if, with, log, lookup, helperMissing) must not be shadowed or removed.","Temporarily register a catch-all helperMissing override to log which helpers templates request."],"exampleFix":"// before: template uses {{formatDate date}} but helper not registered\n// after\nimport Handlebars from 'handlebars';\nHandlebars.registerHelper('formatDate', (date) => new Date(date).toISOString());","handlingStrategy":"validation","validationCode":"const usedHelpers = extractHelperNamesFromTemplates(source);\nconst missing = usedHelpers.filter((n) => !instance.helpers[n]);\nif (missing.length) console.warn('Unregistered helpers:', missing);","typeGuard":"function helperIsRegistered(instance, name) {\n  return typeof instance.helpers?.[name] === 'function';\n}","tryCatchPattern":"try {\n  return template(data);\n} catch (e) {\n  const m = /Missing helper: \"(.+)\"/.exec(e.message || '');\n  if (m) {\n    console.error(`Helper '${m[1]}' is not registered on this Handlebars instance`);\n    return fallbackRender(data);\n  }\n  throw e;\n}","preventionTips":["Register all helpers before compiling templates","Use one shared Handlebars instance for registration and compilation","Add a build-time check that extracts helper names from templates and verifies registration","Grep templates for helper names after upgrading Handlebars","Provide a debug helperMissing override in dev that logs missing names"],"tags":["handlebars","missing-helper","template-runtime"],"backgroundTag":"missing-helper","analyzedSha":"13a7a679910d2adbfe7f6fad61ce8f98426b0378","analyzedAt":"2026-09-02T20:25:07.518Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}