From cb0f646371322e05968b5b79379f1480f2c6d0ac Mon Sep 17 00:00:00 2001 From: bigopon Date: Wed, 1 Feb 2023 13:03:29 +1100 Subject: [PATCH] chore(doc): better dev message for missing delegate and call binding command [skip ci] resolves discourse https://discourse.aurelia.io/t/uncaught-in-promise-error-aur0713-unknown-binding-command-delegate/5086 --- .../runtime-html/src/compiler/template-compiler.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/runtime-html/src/compiler/template-compiler.ts b/packages/runtime-html/src/compiler/template-compiler.ts index d9b65bcac2..3a9e2f30f5 100644 --- a/packages/runtime-html/src/compiler/template-compiler.ts +++ b/packages/runtime-html/src/compiler/template-compiler.ts @@ -1786,7 +1786,18 @@ class CompilationContext { result = this.c.create(BindingCommand, name) as BindingCommandInstance; if (result === null) { if (__DEV__) - throw createError(`AUR0713: Unknown binding command: ${name}`); + throw createError(`AUR0713: Unknown binding command: ${name}. +${name === 'delegate' + ? `The ".delegate" binding command has been removed in v2. Binding command ".trigger" should be used instead. +If you are migrating v1 application, install compat package to add back the ".delegate" binding command for ease of migration. +` + : '' +}${name === 'call' + ? `The ".call" binding command has been deprecated removed in v2. +If you want to pass a callback that preserves the context of the function call, you can use lambda instead. Refer to lambda expression doc for more details.` + : '' +} +`); else throw createError(`AUR0713:${name}`); }