{"record":{"id":"3d0ea365887399bb","repo":"emberjs/ember.js","slug":"you-attempted-to-pass-a-path-as-argument-arg","errorCode":null,"errorMessage":"You attempted to pass a path as argument (\\`${arg.name}={{${resolution.path}}}\\`) but ${resolution.head} was not in scope. Try:\\n* \\`${arg.name}={{this.${resolution.path}}}\\` if this is meant to be a property lookup, or\\n* \\`${arg.name}={{(${resolution.path})}}\\` if this is meant to invoke the resolved helper, or\\n* \\`${arg.name}={{helper \"${resolution.path}\"}}\\` if this is meant to pass the resolved helper by value","messagePattern":"You attempted to pass a path as argument \\(\\\\`(.+?)=(.+?)\\}\\\\`\\) but (.+?) was not in scope\\. Try:\\\\n\\* \\\\`(.+?)=(.+?)\\}\\\\` if this is meant to be a property lookup, or\\\\n\\* \\\\`(.+?)=(.+?)\\}\\\\` if this is meant to invoke the resolved helper, or\\\\n\\* \\\\`(.+?)=(.+?)\\}\\\\` if this is meant to pass the resolved helper by value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/v2/normalize.ts","lineNumber":757,"sourceCode":"    let { path } = value;\n\n    if (path.type !== 'PathExpression') {\n      return;\n    }\n\n    if (path.tail.length > 0) {\n      return;\n    }\n\n    let resolution = this.ctx.resolutionFor(path, () => {\n      // We deliberately don't want this to resolve anything. The purpose of\n      // calling `resolutionFor` here is to check for strict mode, in-scope\n      // local variables, etc.\n      return null;\n    });\n\n    if (resolution.result === 'error' && resolution.path !== 'has-block') {\n      throw generateSyntaxError(\n        `You attempted to pass a path as argument (\\`${arg.name}={{${resolution.path}}}\\`) but ${resolution.head} was not in scope. Try:\\n` +\n          `* \\`${arg.name}={{this.${resolution.path}}}\\` if this is meant to be a property lookup, or\\n` +\n          `* \\`${arg.name}={{(${resolution.path})}}\\` if this is meant to invoke the resolved helper, or\\n` +\n          `* \\`${arg.name}={{helper \"${resolution.path}\"}}\\` if this is meant to pass the resolved helper by value`,\n        arg.loc\n      );\n    }\n  }\n\n  private arg(arg: ASTv1.AttrNode): ASTv2.ComponentArg {\n    assert(arg.name[0] === '@', 'An arg name must start with `@`');\n    this.checkArgCall(arg);\n\n    let offsets = this.ctx.loc(arg.loc);\n    let nameSlice = offsets.sliceStartChars({ chars: arg.name.length }).toSlice(arg.name);\n    let value = this.attrValue(arg.value);\n\n    return this.ctx.builder.arg(","sourceCodeStart":739,"sourceCodeEnd":775,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/v2/normalize.ts#L739-L775","documentation":"In strict-mode templates, a mutable `{{path}}` argument must resolve to something in scope (a local, `this` property, or known helper). When the path's head cannot be resolved, ElementNormalizer rejects the argument because it cannot tell whether you meant a property lookup, a helper invocation, or passing a helper by value.","triggerScenarios":"Compiling a strict-mode template containing a component/helper invocation with an argument like `arg={{somePath}}` where `somePath` is not a declared local, not on `this`, and not a resolvable helper.","commonSituations":"Migrating a template from loose to strict mode (e.g. with `templateStrictMode` in Ember); forgetting `this.` before a property; referencing a helper that is not imported into the template scope; typos in local variable names.","solutions":["If it is a property lookup, change to `arg={{this.path}}` (or `@arg` / a declared local).","If it is a helper, invoke it: `arg={{(path)}}` after importing/defining the helper in scope.","To pass the helper itself by value, use `arg={{helper \"path\"}}`.","If the value is a local (e.g. block param or `let` binding), check spelling and ensure it is actually in scope."],"exampleFix":"// before (strict mode, `fullName` helper not in scope)\n<UserCard name={{fullName}} />\n\n// after (invoke the imported helper)\nimport { fullName } from '../helpers/full-name';\n<UserCard name={{fullName this.user}} />","handlingStrategy":"validation","validationCode":"// Before compiling, ensure every {{path}} arg head is in scope.\nfunction isArgPathInScope(path, scope /* Set<string> of locals/imports */) {\n  const head = path.split('.')[0];\n  return head.startsWith('@') || head === 'this' || scope.has(head);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always prefix context property lookups with `this.` in strict templates.","Import helpers/components used in the template and reference them by the imported name.","Enable the strict-mode compiler locally and fix errors during migration, not in CI.","Use `{{helper \"name\"}}` deliberately when passing helpers as values."],"tags":["glimmer","strict-mode","template-compiler","scope","handlebars"],"backgroundTag":"strict-mode-scope-resolution-failed","analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}