Developer tab: templates - why no line #'s for errors?

Boy, is yaml friggin fussy. WTH is there no line #'s for errors in the template “developer” tab??? try to debug more than 3 lines of template code and youre in for a long night.

Here’s an example. Hours wasted…

anyone know of a replacement jninja integration for HOME ASSISTANT that can evaluate values without having to define them all? and something that gives more screen real estate for code & breaks out errors & results?

frustrated “newish_bee”
Jeff

Not sure why your screenshot shows only about 40 characters of available width for the left hand pane. Your screenshot is from a phone or what?

Using a laptop, I counted approximately 100 on mine with the browser’s magnification at 100%. If I change the magnification, I can display even more.

As for your other questions about reporting line numbers in errors and/or replacing the default Jinja2 interpreter, the short answer is: no.

FWIW, when a complex template results in an error message, I locate the root cause by temporarily removing a chunk of the template. If that causes the error to disappear, I know the problem lies within the chunk I just removed. One or two more iterations of this technique usually narrows it down to the offending line of code.

strange. I’m on a mac w/ Safari. zoom has no effect.

and Chrome:

I see the same thing on my ipads.

FWIW, when a complex template results in an error message, I locate the root cause by temporarily removing a chunk of the template. If that causes the error to disappear, I know the problem lies within the chunk I just removed. One or two more iterations of this technique usually narrows it down to the offending line of code.

Hmm… ok, thats what I do as well, its just strikes me as odd that the most “hacker friendly” home automation platform has this glaring omission in a really key area. The more I dive in, the more I find templating solves more complex issues.

Also, check the home assistant log. The template editor can generate more verbose errors there.

The screenshot I posted above was from Firefox on Linux (monitor is FHD).

Try zooming out in Safari (command and minus key).

good idea. I’ll look.

NOPE. no love there. no errors in the log.

Zoom:

FWIW, the behavior is the same with Firefox. If you decrease magnification, initially you see a bit more of the template within its pane and then everything shrinks without any increase in real-estate for the template’s text.

The main difference is, at 100% magnification, I am seeing more than the paltry 40 characters you are getting.

All I can suggest is you try Chrome or Firefox on your Mac and see if behaves differently.

Ive tried Chrome, Canary, Safari on Mac and FF on Ubuntu 20.04. looks like 100 chars max no matter the screen size which is 2560 x 1440 screen resolution.

100 characters is better than only 40 in your first screenshot.