Closed bobwurtz closed 2 years ago
How do you suggest we fix this? Seems like a Livewire limitation rather than anything to do with us.
@danharrin I'm not sure how to fix it (or what is causing it). Since Filament can redirect correctly to the login page but not to a resource page I assumed this was a Filament issue. How is it a Livewire issue?
Because Livewire binds its own Redirector to the container when a component is rendered, and then an exception is thrown from Livewire. Inside the exception hander it is expecting a different redirector instance. I think.
Login redirects are done in middleware, before the Livewire Redirector is bound.
Any solve ?
Package
filament/filament
Package Version
v2.16.41
Laravel Version
v9.38.0
Livewire Version
No response
PHP Version
PHP 8.1.6
Problem description
A blank, white page was displayed when trying to redirect to a Filament page after an exception was thrown.
Expected behavior
It should have redirected to the dashboard.
Steps to reproduce
Create a new Laravel app, then install Filament. Create a UserResource in Filament.
Then, in
app/Exceptions/Handler.php
use the following to customize how exceptions are handled:Now try and access an invalid page, something like
http://filamentProject.test/admin/users/2
Redirecting to the login page works fine (for unauthenticated users). However, redirecting to the dashboard (or any Filament resource page) ends with a blank white screen. I have included the log output below.
Reproduction repository
https://github.com/bobwurtz/filamentExceptionError
Relevant log output