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

r10maro90's avatar

Livewire works locally but not in production.

I have spend hours trying to figure this out. I followed the instructions on Livewire's doc and got it working locally which is great.

But as soon as I push it to production via laravel forge, it doesn't load the component in the view, and when I inspect the element there's no "wire:id" generated, also no script tag or styles from livewire is shown.

Here's what I have tried do far but none worked:

  • published the livewire assets with this command "php artisan livewire:publish --assets"

  • Went into config/livewire and change

'asset_url' => null, to 'asset_url' => 'http://localhost',

  • SSH into the server and cleared the cache and route

I don't know what else to try. Any help would be appreciated.

Thanks.

0 likes
8 replies
Wakanda's avatar

@r10maro90 is it recommended that you put your livewire scripts first before any other scripts

jlrdw's avatar
asset_url' => 'http://localhost',

That doesn't look correct for production.

r10maro90's avatar

Okay. Can you please shed some light on the correct way?

Please or to participate in this conversation.