Getting 404 when loading assets
Hi
My Filament admin panel has been working for some time, but just today I get a 404 when loading the assets
If i try to access the assets directly
https://xxxx/filament/assets/app.css?id=ceb9a486dfc44ebe8adaa3bd510821e8
I get the the css but when loading the panel the css is not loaded and in the console I can see 404 errors
Yes, I have found other discussions here and it does not solve my issue
33 Replies
Anything else in the console? What did you change last before it stopped working? Any URL (sub)domain changes?
Not that I can think of
the same code is deployed to a production server and does not have the issue
the 'funny' thing is that if I access the assets directly I can see it
can you post a screenshot of the console and errors?
seems to be something with your local dev setup then
and no, there only the 404 reagrding the assets in the console
it's not on local
local is working fine
Weird, how does it look when you open the asset directly? same url?
what's the url that includes those assets where it doesnt work?
That's weird ... any custom middlewares?
If I do a 'view source' on the page that get the 404 and click on the link to the assets, I get the assets
yeah same, it does show the file content in the response tab as well
yes, but they have been there for a very long time
tried to uncomment them same result
Ok, no idea really, sorry. Just ... did anything, anything at all change, before it stopped working? server configuration, new code, an update ... anything?
things mostly never just happen, and people think whatever they did can't be the reason, but something must habve happened somewhere
no code changes to the filament part, no server changes
I agree that something must have happend
I have to look at it at at later
thanks for your input
or maybe it's time for another solution
sure! if you find the cause, or need any more help,let me know
maybe try just restarting the server to see if anything changes, and try to reproduce locally
done 10 restart and it does not happen locally or in production
I'd probably start dd() debugging the filament asset controller
I did a Log::info in several places
Funny thing is... I just looked at the HTML that is generated local and on the test server and It's not equal
e.g. local I have
on the test server i don't have the somment and the style is on one line
should not make a difference, but I wonder why the HTML is different
I have added a Log::error($file) in the assets controller and i only get 3 hit's
Might still be related to your subdomain. Since it's working on production without a subdomain 🤔
well.. maybe.... but why now ?
It's been working for 6-7 months
I absolutely agree that something must have changed, but I cannot figure out what, meaning everything on the site is working except filament panel
If I look at the servers error.log for I can see it tries to access
/var/www/xxx/current/public/filament/assets/app.js and that gives an error
and I agree... the file does not exists in that path
So the test system is also not new? It has worked before?
and I agree... the file does not exists in that pathYeah, the files are served through Laravel. But the same is true for Livewire, which also works.
yes, the test system has been working for 5-6 months
Yes, I use livewire on the front end and that works fine
I don't go to the admin panel on the test system on a daily bases so it could be that it's not been working for 2-3 week, however the code fir filament has not been changed for months
Make sure the server config wasn’t changed to serve static files directly. If so you’ll need to add a block to tell the server to serve anything under the filament path with php instead.
But that would also apply to Livewire. Unless Livewire.js was published to public folder? 🤔 @rabol Is the Livewire file inside the public folder or also served via Laravel?
I had to publish it today using the php artisan livewire:publish --assets command
livewire.js is in /public/vendor/livewire/livewire.js
but.... there is a route and if I try t access the file directly it works
Just recommending what I’ve had to do one some of our servers.
sure... I'm not complaining 🙂
Filament
Fix Filament assets not loading in Nginx by Ida Bagus Gede Pramana ...
Filament is a collection of tools for rapidly building beautiful TALL stack apps, designed for humans.
like this ?
Yep
It is weird though that the server would update its own config on this though. Has any one else been doing anything with the server.?
but the above has never been in the config before as I have never had any issues
one sec.....
i recently added this to the server config:
`
the above was the issue ....
Makes sense.