From 28ba735b254fb8a0d8fa7ec4515923178b0ddc4c Mon Sep 17 00:00:00 2001 From: master Date: Mon, 26 Mar 2018 22:29:37 +0300 Subject: [PATCH] makes friendly error message for TypeError: Cannot read property 'attrToRemove' of undefined at ViewCompiler._compileElement (aurelia-templating.js) --- src/view-compiler.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/view-compiler.js b/src/view-compiler.js index 35045a4a..db9d2687 100644 --- a/src/view-compiler.js +++ b/src/view-compiler.js @@ -393,7 +393,11 @@ export class ViewCompiler { } else if (elementProperty) { //custom element attribute elementInstruction.attributes[info.attrName].targetProperty = elementProperty.name; } else { //standard attribute binding - expressions.push(instruction.attributes[instruction.attrName]); + if (typeof instruction.attributes[instruction.attrName] == 'undefined') { + console.log('Fatal error in attribute',instruction.attrName) + } else { + expressions.push(instruction.attributes[instruction.attrName]); + } } } } else { //NO BINDINGS