Closed dbpolito closed 1 month ago
What actually goes wrong?
It's a very specific error, if a have a Controller
with some injection on __construct
, it throws this error:
Target [xxxContract] is not instantiable while building [xxxController, xxxRepository].
As the route is already loaded but referencing the old container, it's trying to inject using the wrong container, which probably got cleared.
The error happens on the livewire action, at the livewire.update ajax.
Routes instances are still referencing the old container...
I was hitting this error in a filament / livewire app, more specifically here: https://github.com/livewire/livewire/blob/main/src/Mechanisms/PersistentMiddleware/PersistentMiddleware.php#L149
Using cached routes does not hit this problem, that's why i'm only doing to uncached routes.