F
Filament15mo ago
Harry

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
toeknee
toeknee15mo ago
Where does it occur? It means one component is rendering two divs at the parent level on the single component
wyChoong
wyChoong15mo ago
Some browser extensions inject HTML and causes that
Harry
Harry15mo ago
Occurs on every page of the admin panel I wondered this too, but I've tried it with different browsers etc and same issue
wyChoong
wyChoong15mo ago
Another possible reason is your web server or cdn stripping off livewire’s HTML comment
wyChoong
wyChoong15mo ago
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...
Harry
Harry15mo ago
Nice thinking... let me take a look at the Cloudflare settings
wyChoong
wyChoong15mo ago
If you serving thru cloudflare then 100% is that, faced that before
Harry
Harry15mo ago
I believe you're correct 🙂 Changing a couple of CF settings removed the error for me. Thank you!
wyChoong
wyChoong15mo ago
You’re welcome