Css and Js not loading: ERR_INVALID_HTTP_RESPONSE
I'm creating a new Laravel project (v10.18), installing the latest version of Filament v3, following the Installation section of the docs, and running the server with 'php artisan serve', but when I open the admin panel, the CSS and js files don't load and throw a 'net::ERR_INVALID_HTTP_RESPONSE' error (pic 1). So from what I could gather online, it seems that the Laravel 'php artisan serve' server can't load files from the 'public' directory for some reason, so instead I try with 'php -S localhost:8000 -t public' and now the files load fine, but now Livewire throws a 'net::ERR_ABORTED 404 (Not Found)' error (pic 2). Does anybody know what can I do?
2 Replies
'php artisan serve ' should is ok. you do it again
try clearing your browser cache,
I figured it out thanks to this post https://stackoverflow.com/questions/59443178/php-artisan-serve-throws-errors-when-zlib-activated
The problem is not with filament but with a combination of 'php artisan serve', loading assets from 'public', and the zlib output compression being active. I have no idea how or why this happens, but disabling it in your php.ini works: changing 'zlib.output_compression=On' for 'zlib.output_compression=Off'. Remember to restart the 'php artisan serve' command afterward. I'm using Xampp on Windows btw. I'm assuming this is a non-issue in a production server.
Stack Overflow
php artisan serve throws errors when zlib activated
I noticed a strange behaviour in my local development machine.
I'm developing a Laravel/VueJS based application.
My system:
Ubuntu 18.04.3
Laravel 5.5.44
PHP 7.3.12
After having launched the ...