laravellaravel-livewirelaravel-filamentfilamentphplivewire-3

Why am I getting 401 errors on Livewire uploads


When I try to upload a file on the production server the upload goes to 100% and then says error uploading. If I check the browser console it shows the upload failed because of a 401 error.

I'm running Laravel 11, Livewire 3, and Filament 3

I thought this may have been a signed url issue as the requests are going through Cloudflare, so I turned off Cloudflare proxying (also to verify Cloudflare's auto-minification wasn't messing anything up) - no change. I set the following in bootstrap/app.php - no change.

->withMiddleware(function (Middleware $middleware) {
        $middleware->trustProxies(at: ['*']);
    })

finally I commented out the check for a signed url in Livewire's src file just to be sure this was not the issue

vendor/livewire/livewire/src/Features/SupportFileUploads/FileUploadController.php

//abort_unless(request()->hasValidSignature(), 401);

What else could be causing this issue?


Solution

  • I'm not sure the actual cause but I had it running on Laravel Octane with FrankenPhp. As soon as I disabled that the problem went away. I'll try to investiagte and post the actual cause of the issue when I have a bit more time.