Skip to content

Commit d477ac6

Browse files
committed
Include element tag name in callback error message
Show which element the {{on}} modifier is attached to, helping locate the issue when modifiers are forwarded via ...attributes.
1 parent df17c40 commit d477ac6

File tree

1 file changed

+1
-1
lines changed
  • packages/@glimmer/runtime/lib/modifiers

1 file changed

+1
-1
lines changed

packages/@glimmer/runtime/lib/modifiers/on.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class OnModifierState {
8585
throw new Error(
8686
`You must pass a function as the second argument to the \`on\` modifier; you passed ${
8787
userProvidedCallback === null ? 'null' : typeof userProvidedCallback
88-
}. While rendering:\n\n${args.positional[1]?.debugLabel ?? `{unlabeled value}`}`
88+
}. While rendering:\n\n${args.positional[1]?.debugLabel ?? '(unknown)'} on <${this.element.tagName.toLowerCase()}>`
8989
);
9090
}
9191

0 commit comments

Comments
 (0)