Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Eloïse's avatar

Multiple root elements detected. This is not supported, but it does not seem to be a root problem

Hello, I'm facing this issue on a livewire blade view but I'm not able to find where, so I have extremely simplified the view to a minimal view like that :

<div>
 test tes test
</div>

The component is integrated like that

<body class="bg-gray-700  sm:overscroll-y-none overscroll-x-none overflow-x-hidden sm:overflow-x-auto ">
        @livewire('modal-search')
        @yield('body')
    </body>

after that I always have the error so what can I do ? Thanks for your help,

0 likes
2 replies
vincent15000's avatar

You probably have more than one root element in the livewire component view.

This will not work.

<div>
	...
</div>

<div>
	...
</div>

But this will work.

<div>
	<div>
		...
	</div>

	<div>
		...
	</div>
</div>
Eloïse's avatar

Thanks, I know it, but it was not the problem. I solved the problem, if I remember the solution I w'll post it later

Please or to participate in this conversation.