Skip to content

T4004: Template root error ​

Cause ​

A template must have exactly one root element, and the root cannot use if, each or other directives.

Example ​

xml
<contract>
{ "name": "Card", "role": "group", "parts": ["root"] }
</contract>
<template><div class="root"></div><div></div></template>

What you see ​

text
ERROR  T4004  app/components/Card.tess:4:35
  A template must have exactly one root element, found 2. Wrap them in a single element such as <div class="root">.
  Run `tessera explain T4004` for details.

Fix ​

Wrap everything in one element such as <div class="root">.

All errors and warnings