Behram Khattak's avatar

Livewire component and livewire styles and scripts not rendering on live server.

I have added Livewire load more button feature to an existing website built on Laravel and bootstrap but Livewire seams to not rendering on a live server.

@livewire('load-quotes-by-topics', ['id' => $id_number ])

Livewire displays this on live server, but works perfectly on local server.

I have applied every solution but still not working.

0 likes
16 replies
vincent15000's avatar

Which Livewire version are you using ?

Perhaps you could manually delete the cache files in the bootstrap folder an let the application regenerate them ?

Have you checked the PHP version requirements ?

1 like
vincent15000's avatar

@Behram Khattak Delete all files from inside the bootstrap/cache folder and try once again.

1 like
vincent15000's avatar

@Behram Khattak You can do that on the live server too. It's only cache files.

Are you sure to have the right PHP version on the production server ?

vincent15000's avatar

@Behram Khattak Have you installed Livewire on the production server ?

composer install

I don't see many other reasons ...

Behram Khattak's avatar

@vincent15000 actually when i checked the composer.jsob file on production so livewire was listed in the dependencies section but it was not present in bootstrap/cache/services.php file but in local environment i can see livewire service provider listes in services.php file and i think i should manually install livewire on the production using composer.

1 like
vincent15000's avatar
Level 63

@Behram Khattak It seems likely you have deployed the application in production a first time. Then you have added Livewire and you need now to add Livewire in production.

As Livewire is already installed in your local environment, it's necessarily present in the composer.json file.

In this case you need to run composer install in the console on your production server.

Installing Livewire manually via composer require livewire/livewire is not a good idea because you will have differences in your git management. In production you should only run git pull and nothing else.

1 like
Behram Khattak's avatar

Yeah thats what i did and my issue is solved thanks for helping.

1 like

Please or to participate in this conversation.