un-useful error message compiling template
See original GitHub issueUpgrading an old application to Ember 3.26.
<span {{action 'doSomething'}}>
</span>
Expected Compiles successfully or logs useful error message
Actual
Template Compiler Error (TemplateCompiler) in my-project/application/template.hbs
Cannot read property 'start' of undefined
The problem seems to be the action. Removing it fixes the error.
Obviously we shouldn’t be doing this any more, and using a button
with the on
modifier instead. But the compiler error message does not help the developer find the problem and fix it.
Fix 1: Show location of error in .hbs file (line, column) Fix 2: Help the developer know what they’ve done wrong. Old tutorials will have developers writing code like this.
EDIT: Now happening with <div><button type="button"/></div>
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
C++ compiler doesn't give useful error messages
When using expression templates (e.g. Boost) and an error is detected, the original source line MUST be supplied; otherwise, the user has no...
Read more >Why are template errors so horrendously verbose? : r/cpp
A lot of the time, template errors are extremely verbose, but depending on the actual problem different parts of those errors can be...
Read more >Tools to generate higher-quality error messages for template ...
I'm working since a long time with templates and error messages have ... While it is good that compiler writers work on improving...
Read more >Why are C++ template error messages so horrific?
Template error messages may be notorious, but are by no means always long and unreadable. In this case, the entire error message (from...
Read more >Writing Good Compiler Error Messages | Code → Software
Write messages in first person plural. That is, use “we”. For example “we see an error”. This personifies the compiler as a team...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just a little update in case someone else faces the same deprecation scenario. I was using ember-gestures for swipe actions. I was able to get rid of the ember-gestures dependency very easily with an ember-modifier:
Thanks @pzuraq. Linking these related issues for future reference :