{# Page assets live INSIDE the content block (the dj-root): dj-navigate swaps only that region, so anything in extra_head/extra_scripts is missing when a visitor arrives by live navigation. Behaviour lives in static/js/site-pages.js. #}
DJE-043 Error Template
Missing dj-root on root element
Error message
LiveView updates not applied — page appears staticThe root element of a LiveView template must have the dj-root attribute. Without it, djust's client-side JavaScript cannot find the target element for DOM patching, and updates received over WebSocket will not be applied to the page.
liveview setup template
Affected versions: >=0.2.0
Solution
Recommended
Add dj-root to your template's root element
Wrap your template content in a single root element with the dj-root attribute.
Before (problematic)
<!-- counter.html -->
<div>
<h1>Count: {{ count }}</h1>
<button dj-click="increment">+1</button>
</div>
After (fixed)
<!-- counter.html -->
<div dj-root>
<h1>Count: {{ count }}</h1>
<button dj-click="increment">+1</button>
</div>