The template is lazily evaluated, so the error only comes up when the template is executed.
About 1: #30635 is tracking this, and we should definitely address it (yes, I was the original reporter and then forgot about it by the time I started maintaining the package 🤦 ). Since this part of the bug would be a duplicate, I'm changing the title of the bug to only refer to the second point.
About 2: I think this is working as intended. Templates are not necessarily valid when parsed the first time, as they might only become so once sub-templates are added. We could special-case templates that contain no actions as you point out, but I'm not sure this is the best way forward. It would definitely improve UX, but it adds a bit complexity and any unit-test that covers the template at least once would provide the same value.
That said, I am not against such a change, but I'd be curious about @kele's opinion on it before we decide to address it.
changed the title
html/template: confusing error message when template contains <textarea/>May 17, 2022