Error codesComponents

Content inside a <template> or a raw-text element must be static

MARKLESS_DETACHED_CONTENT_DYNAMICerrorMarkless raises it while it builds your .tsrx files.

The message

MARKLESS_DETACHED_CONTENT_DYNAMIC: `<source>` inside <<ownerTagName>> needs the page to find it again in the browser, but <where>, so no handler, binding, or component there can ever run or update.
The browser resumes a server-rendered page by counting its elements in document order. The HTML parser keeps what a <template> or a raw-text element such as <noscript> holds out of that order, so nothing inside one can be located, and a handler or binding there would be silently dead.
Keep the <<ownerTagName>> content to plain elements, text, and literal attribute values. Move anything interactive outside it, and clone the template content from a handler or attach if it must become live.
https://markless.dev/errors/MARKLESS_DETACHED_CONTENT_DYNAMIC

Words in angle brackets change from case to case.

Why

The browser resumes a server-rendered page by counting its elements in document order. The HTML parser keeps what a <template> or a raw-text element such as <noscript> holds out of that order, so nothing inside one can be located, and a handler or binding there would be silently dead.

Fix

Keep the <<ownerTagName>> content to plain elements, text, and literal attribute values. Move anything interactive outside it, and clone the template content from a handler or attach if it must become live.

Where Markless raises it

All error codes