After downloading the checked-in code from Github to a new system, I noticed that Livewire was not rendering. Instead, I was seeing the @livewireStyles, @livewireScripts, and @livewire(‘my-livewire-component’) on the blade page where the Livewire component was supposed to be displayed.
I tried running composer dump-autoload. clearing the cache by running php artisan co:cache but nothing helped!
Finally what worked was a funny approach.
The Solution To Laravel Livewire components not rendering on page
I opened my layouts file where both @livewireStyles and @livewireScripts were called and made some random change (added a space) and then saved the file.
I then refresh the page and voila!
The @livewireStyles and @livewireScripts were gone from the page!
But the Livewire component was still not rendering.
So, I now went to the blade file where I had referred to the Livewire component, made some random change, and then, saved the file.
Then, I went back to my browser and just like that, everything worked just fine! Phew!