Think we need more helpful errors, ie, including the calling site info, when using ECR. I've a Kemal application with hundreds of routes and I see this not very helpful message when I missed defining "title" var for one of the routes.
Error target foo failed to compile:
Showing last frame. Use --error-trace for full trace.
In views/form.ecr:9:61
9 | <h1 class="title is-3 has-text-dark"><%=title%></h1>
^----
Error: undefined local variable or method 'title' for top-level
crystal -v
Crystal 0.33.0 (2020-02-14)
LLVM: 9.0.1
Default target: x86_64-apple-macosx
Quick update, I can tell the offending line by using --error-trace however there is now too much noise to wade through just to get to the line number. Would be nice if the original error somehow just included the line number where the ECR macro is being called.
GET!
Closing. --error-trace is the way to go until we do something like #8410