Expected @livewireStyles and @livewireAssets to be parsed when following the tutorial on Livewire integration, using:
<?php
use Illuminate\Support\Facades\Blade;
add_filter('wp_head', function () {
echo Blade::render('@livewireStyles');
});
add_filter('wp_footer', function () {
echo Blade::render('@livewireScripts');
});
What actually happens?
@livewireStyles and @livewireAssets are printed as text to the screen. Debug shows that the Livewire boot never happens and the Blade directive is never set.
In my case, it works fine locally. The failure happens after deploying to the server (BlueHost). Perhaps it is a missing server requirement. I have tried with about 6 sites. It always works locally. It sometimes works on the server. I haven't been able to identify any real differences between the sites where it magically works versus one where it does not.
I thought it would be a cache issue, but after clearing caches a lot nothing changes. At one point I put error_log() into Livewire facade and boot files, they were never called. I deleted the entire Livewire /Mechanisms directory, and this did not throw an error.
ChatGPT says we have to register the Livewire service provider to ensure it loads. But this isn't mentioned in the Acorn docs, and doesn't usually seem required.
Version
4.3
What did you expect to happen?
Expected @livewireStyles and @livewireAssets to be parsed when following the tutorial on Livewire integration, using:
What actually happens?
@livewireStyles and @livewireAssets are printed as text to the screen. Debug shows that the Livewire boot never happens and the Blade directive is never set.
Steps to reproduce
Install Acorn. Add Livewire following the tutorial at https://roots.io/acorn/docs/using-livewire-with-wordpress/.
In my case, it works fine locally. The failure happens after deploying to the server (BlueHost). Perhaps it is a missing server requirement. I have tried with about 6 sites. It always works locally. It sometimes works on the server. I haven't been able to identify any real differences between the sites where it magically works versus one where it does not.
I thought it would be a cache issue, but after clearing caches a lot nothing changes. At one point I put error_log() into Livewire facade and boot files, they were never called. I deleted the entire Livewire /Mechanisms directory, and this did not throw an error.
ChatGPT says we have to register the Livewire service provider to ensure it loads. But this isn't mentioned in the Acorn docs, and doesn't usually seem required.
System info
Windows 11.
Log output
Please confirm this isn't a support request.
Yes