Can't view any invoice in client portal - Livewire is not defined console error

Latest version of the app v5.8.9-W148
Console log in invoice view for client showing livewire.js 404 so invoice fails to load
There were no changes made on my end except for update. All directory permissions are correct.

Hi,

@david do you have any suggestions?

This problem also means payments aren’t working

in the network tab, what is the full path to the livewire.js file?

the full path is https://{mydomain}/livewire/livewire.js (giving 404)

@icedroit this looks like a edge case. I’ve changed the way we load the livewire bundle in the next release, more info on this issue here:

It seems nginx is not recognizing the laravel route that pointing to the livewire assets, and these command result in ‘No publishable resources for tag [livewire:assets]’: php artisan livewire:publish --assets, even tried force
I can update to any new urgent release even beta asap if it fixes it because I need clients to be able to pay the invoices online

@icedroit

What does your default URL look like?

does it include /public?

which default URL?
if you mean the app url in .env, I’ve tried changing it- does not make difference

Are you using nginx? if yes, does adding the additional nginx config defined in the livewire installation fix the issue?

If not, what do you see when you navigate to:

http://ninja.test:8000/livewire/livewire.js

I get nginx’s 404 when navigating to /livewire/livewire.js

in config/livewire.php I added 'asset_url' => 'http://localhost', no difference still 404 (even after making sure all caches were cleared)

livewire 3 no longer uses the asset_url so that won’t work.

what server config are you using? nginx/apache?

I am using nginx on ubuntu
I have control over the vhost file

@icedroit

If you follow this configuration for NGINX, does it work?

I added this to my nginx vhost file

location = /livewire/livewire.js {
    expires off;
    try_files $uri $uri/ /index.php?$query_string;
}

no difference still 404 in invoices and payments

@icedroit

I’ve changed the way we bundle livewire.js now, this is now built as ESM, I’ve tagged v5.8.11 , let me know if issue persists.

Yes v5.8.11 fixed this. Thank you

1 Like

I’m having the same issue in version 5.8.21 self-hosted.
All working fine, except for quotes/invoices on the client portal.

Error is due to 404 on {domain}/livewire/update but the Invoice Ninja is installed in a subdirectory {domain}/{subdir}
I’ve tried cleaning the cache, logging in with ssh and running PHP artisan:optimize.
Checking the fix by benjamincrozat.com mentioned above.

Any suggestions ?
Thanks

can you confirm your APP_URL in .env is set to your public facing url including https ?

1 Like

APP_URL is https://{domain}/{subdomain}/public indeed
same as ASSET_URL

the .env file hasn’t changed for several months, was working before the update