New Custom Page 404
Hi,
I created a new custom page (the first one) in my project using
php artisan make:filament-page QueueDashboard
.
However the page is not reachable, and not showing up in the sidebar. Using route:list
shows the route
But when I call /admin/queue-dashboard, I get 404. Whats wrong ?? 😓
The Class has the following content:
55 Replies
Is there a
->discoverPages(...)
in the AdminPanelProvider?@Leandro Ferreira yes, its there
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
weird, this page should show in the sidebar
any Filament customizations?
Do you have a
Pages
Resource?
Hm. But shouldn't conflict as it doesn't have a /pages
prefix in the URL@Dennis Koch I think no
I noticed, there is also a
->pages([Pages\Dashboard::class])
in AdminPanelProvider, but commenting or adding the page also didn't help. Also tried all variants of cache:clear, optimize:clear ...Can you add a mount method with a
dd()
inside to check whether the page is not found or maybe any model your trying to load?Added it but it doesn't get triggerd. When I try to add it manually in the ->pages() or call ->url(), there is an exception
any Filament customizations?
appserviceprovider, custom menu..?
@Leandro Ferreira not really :/
php artisan about --only=Filament
what is the filament version?could you share the AdminProvider file?
ok, I think
any routes/web.php customization?
did you try to add this page in some navgroup
protected static ?string $navigationGroup = 'Administration'
?in my project using php artisan make:filament-page QueueDashboard.Can you try this with any other page and check whether it works?
I removed all routes from web.php, also added the $navigationGroup, still not showing and 404 :/
I deleted the QueueDashboard page and created a new one "Hello", same result
Can your create a fresh project, install filament and create a page to check that that works.
Any route that might collide with the page?
Can you maybe share the full route list?
I'll try it later
What happened to
admin/queue-dashboard
?i deleted it, replaced it with hello. Thought possibly a name collision because of "dashboard"
I believe this is a customization that you did... did you upgrade from v2 or is it a v3 installation?
It's a new project, started with v3 back in January. It has not much frontend code, mainly backend processing and Laravel Horizon
are you able to share this project on github?
99% a fresh Filament install will work
It's still on Laravel 10 if that's possibly relevant
no, it was supposed to work
are you using plugins?
"awcodes/filament-addons": "^0.3.14",
"codewithdennis/filament-select-tree": "^3.1",
"filament/filament": "^3.0-stable",
"filament/forms": "^3.0-stable",
"filament/notifications": "^3.0-stable",
"filament/tables": "^3.0-stable",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/horizon": "^5.24",
"laravel/octane": "*",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"league/flysystem-aws-s3-v3": "^3.0",
"league/glide-laravel": "^1.0",
"opcodesio/log-viewer": "^3.1",
"osiemsiedem/intervention-image-vips-driver": "^0.11.0",
"predis/predis": "^2.0",
"ralouphie/mimey": "^1.0",
"shuchkin/simplexlsx": "^1.0",
"spatie/temporary-directory": "^2.2",
"spiral/roadrunner-cli": "^2.6.0",
"spiral/roadrunner-http": "^3.3.0"
Roadrunner is installed, but app is running in fpm Docker container
maybe you could provide a min repo on Github to reproduce this issue
Ok, now I get the same behavior with a fresh installation. I'll upload it in a minute
GitHub
GitHub - btxtiger/laravel-filament-404-bug
Contribute to btxtiger/laravel-filament-404-bug development by creating an account on GitHub.
Are you getting the laravel 404 page or the server 404 page.?
laravel 404
I’m not seeing anything standing out to me.
The issue appeared in both, Docker nginx php fpm and also local artisan serve
Can you rollback filament one version at a time to see if a recent release might have broken something.
Does it work if you manually register the page in the ->pages() modifier?
Downgraded until 3.2.39 (maximum possible), same issue
Also adding to pages() has no effect
Highly unusual. The code looks good to me. I have custom pages working fine on 3.2.92. I’m leaning toward it being something in your sever, maybe permissions on the directory. Not sure.
Do resources work?
Just having a hard time figuring out why the route is registered but laravel is throwing the 404. Just doesn’t make sense.
I got it working digging into
HasComponents.php
and commenting this section:However how can I still have cached Components after running
cache:clear, optimize:clear, view:clear ?
your repo is working here
Ah, cached components in filament are different than normal laravel optimization.
php artisan filament:clear-cached-components
I guess that was the issue 👍
thanks everyone for helping!!
One last question: Shouldn't it be possibly a default behavior to clear this component cache automatically after creating a new page, to prevent running into such issue? I never actively cached any component, never read of this command before tbh
They don’t cache by default. So if you didn’t run the command then they shouldn’t have been cached.
weird because it is a fresh install, right?
My thought too.
yes, was a fresh installation, new dir, using laravel new ...
Did you run optimize?
I wonder if there’s a tie in that will run the component cache on optimize.
no not as I remember, I tend to run optimize:clear to prevent any issues in dev env
Yea. Really odd.
Not seeing anything in the code that would run it without calling it specifically either.
Oh well, glad you figured it out.
possibly running
php artisan filament:install --panels
?
idk. I'll let you know if I find it 😄Please do, but I’ve never had this happen in any of my apps.
me too 😅
But to answer your earlier question, it doesn’t need to be cleared automatically when creating a new page because it shouldn’t be cached in dev. And, if you need it, should only be part of your deploy script, which would only run after you’ve pushed be code to the server anyway.
Thank you for being patient with all this though. And sticking with filament. I’m sure it’s been a troublesome day to say the least.
great, thx. i had same issue, and same solution.