Help with 'Multiple Root Elements Detected
I have an odd issue on the admin panel whereby I get warnings in the console about Multiple Root Livewire elements being detected. Oddly enough, this doesn't seem to appear in my local environment. I've attached a screenshot of the errors in the console.
I'm not doing anything too crazy with Filament, not using notifications etc and haven't customised it other than adding one page (however this warning appears on every page in the admin panel).
Any thoughts?
9 Replies
Where does it occur? It means one component is rendering two divs at the parent level on the single component
Some browser extensions inject HTML and causes that
Occurs on every page of the admin panel
I wondered this too, but I've tried it with different browsers etc and same issue
Another possible reason is your web server or cdn stripping off livewire’s HTML comment
GitHub
Multiple root elements detected. This is not supported · livewire l...
hi everybody livewire.js?id=21fa1dd78491a49255cd:12 Livewire: Multiple root elements detected. This is not supported. See docs for more information https://laravel-livewire.com/docs/2.x/rendering-c...
Nice thinking... let me take a look at the Cloudflare settings
If you serving thru cloudflare then 100% is that, faced that before
I believe you're correct 🙂 Changing a couple of CF settings removed the error for me. Thank you!
You’re welcome