{"record":{"id":"084d2f3ec3604971","repo":"emberjs/ember.js","slug":"you-can-only-pass-two-positional-arguments-event","errorCode":null,"errorMessage":"You can only pass two positional arguments (event name and callback) to the `on` modifier, but you provided ${args.positional.length}. Consider using the `fn` helper to provide additional arguments to the `on` callback on ${selector}","messagePattern":"You can only pass two positional arguments \\(event name and callback\\) to the `on` modifier, but you provided (.+?)\\. Consider using the `fn` helper to provide additional arguments to the `on` callback on (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@glimmer/runtime/lib/modifiers/on.ts","lineNumber":104,"sourceCode":"      arg1 ? valueForRef(arg1) : undefined,\n      CheckFunction,\n      (actual) => {\n        return `You must pass a function as the second argument to the \\`on\\` modifier; you passed ${\n          actual === null ? 'null' : typeof actual\n        }. While rendering:\\n\\n${args.positional[1]?.debugLabel ?? `{unlabeled value}`}`;\n      }\n    ) as EventListener;\n\n    if (DEBUG && typeof userProvidedCallback !== 'function') {\n      throw new Error(\n        `You must pass a function as the second argument to the \\`on\\` modifier; you passed ${\n          userProvidedCallback === null ? 'null' : typeof userProvidedCallback\n        }. While rendering:\\n\\n${args.positional[1]?.debugLabel ?? '(unknown)'} on ${selector}`\n      );\n    }\n\n    if (DEBUG && args.positional.length !== 2) {\n      throw new Error(\n        `You can only pass two positional arguments (event name and callback) to the \\`on\\` modifier, but you provided ${args.positional.length}. Consider using the \\`fn\\` helper to provide additional arguments to the \\`on\\` callback on ${selector}`\n      );\n    }\n\n    let once: boolean | undefined = undefined;\n    let passive: boolean | undefined = undefined;\n    let capture: boolean | undefined = undefined;\n\n    if (DEBUG) {\n      let { once: _once, passive: _passive, capture: _capture, ...extra } = reifyNamed(args.named);\n\n      once = check(_once, CheckOr(CheckBoolean, CheckUndefined), (actual) => {\n        return `You must pass a boolean or undefined as the \\`once\\` argument to the \\`on\\` modifier; you passed ${actual}. While rendering:\\n\\n${\n          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme\n          args.named['once']!.debugLabel ?? `{unlabeled value}`\n        }`;\n      });\n","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/runtime/lib/modifiers/on.ts#L86-L122","documentation":"Error \"You can only pass two positional arguments (event name and callback) to the `on` modifier, but you provided ${args.positional.length}. Consider using the `fn` helper to provide additional arguments to the `on` callback on ${selector}\" thrown in emberjs/ember.js.","triggerScenarios":"Thrown at packages/@glimmer/runtime/lib/modifiers/on.ts:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}