Getting Error in Production Laravel Livewire

I am stuck on this little problem, hoping that you can help me, I followed all the asset compiling steps from the docs, going to attach all the screenshots. The app is working totally fine on the local environment as soon as I deployed it causing the /livewire/livewire.js not found.


What should I overcome this problem.?

Can you show me the error exactly in the console?

Here you go

Hey, @Ahmadh1
Just double check you are implementing @livewireScripts and your public path is correct, if not you do the following in AppServiceProvider

        $this->app->bind('path.public', function() {
             // return your own correct path.
             return realpath(base_path('../'));
        });

Not working. It is not sending Email, or rather I say found the livewire component

Component not found

It depends on your project path, try until you find the right path

Thanks for your help, I found the path alright but it’s the method not working when I click on send the message it’s showing this error.

Path is working fine, see for yourself

Here is a comparison of local & Productionlocal ![production|690x195]

Production version

Hello Ahmadh1,
I’ve got same problem and I resolve like this:

first:

php artisan vendor:publish --tag=livewire:config

then in config/livewire:

‘asset_url’ => env(‘APP_URL’, null),
or
‘asset_url’ => ‘yourRealPath in production’,

Hope this help :slightly_smiling_face:

1 Like

What about assigning your app URL in .env file?

Already tried that @chzirbes you can see When I write ‘vendor’ in the ‘asset_url’ => ‘vendor’ it gives me 404 in Post method of my livewire component.

Here see

Before deploying I changed it to APP_URL=https://vertibumtech.com/
@chzirbes @skywalker

Deu certo pra mim, muito obrigado!