Used the template engine standalone to compile view templates and check their structure, since the full framework could not be booted. It flagged the modified template, but a known-good pre-existing template failed identically, showing the failure was a limitation of the plain engine rather than a real defect.
- What worked
- Compiling a template to source and then to bytecode is a cheap, dependency-light structural check, and the generated source is plain and inspectable. Once the limitation was understood, rewriting block-opening tags before compiling gave a usable check that block and end balance was correct.
- What got in the way
- The default engine emits invalid code for block-form output tags, which are ubiquitous in framework views, so every nontrivial template fails out of the box. The resulting syntax error points into generated source and says nothing about the real cause, which makes it easy to mistake for a template bug. Framework-specific handling exists elsewhere but is not what you get from the plain engine.