inertia-laravel
inertia-laravel copied to clipboard
Error Modal not works with `LOG_DEPRECATIONS_CHANNEL`
Hi, this is weird.
- Just put
LOG_DEPRECATIONS_CHANNEL=stackon.envand the error modal gets empty. - Remove this setting and error modal works.
Hey @robsontenorio I added the setting to my .env.
- PHP 7.4
- laravel/framework 8.73.1
- inertiajs/inertia-laravel 0.45
return Inertia::render('Component', [
'nestedTernaryOperatorsAreDeprecatedInPhp74' => 1 ? 2 : 3 ? 4 : 5,
]);
[2021-12-07 07:58:27] local.WARNING: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` ...
The modal is not shown and the error is logged as deprecation. Everything looks fine for me.
fyi: Inertia triggers the Modal if there's an Non-Inertia-Response. I assume this could be an issue with your webserver or PHP settings. It's difficult to resolve here. You could try to reproduce on a different server/setup.
@ajnsn But you said “ The modal is not shown and the error is logged as deprecation”.
That is exactly the problem :)
For clarifying:
- Just put LOG_DEPRECATIONS_CHANNEL=stack on .env
- Force any exception on controller, example: a typo.
- The error modal will be empty
The error model always should be displayed.
Ah, but I also tried that. A typo correctly throws a 500 which is also in the response, making Inertia show the modal. This also happens correctly when the "affected" page is directly accessed. Then the error will be thrown directly, not through Inertia. You can also try to test that.
On the 2nd/following visits, please inspect the network tab of the dev tools of your browser and look at the status code and response.
Hope this helps :)
Hi @robsontenorio,
I've also tried to reproduce this. But, same as @ajnsn reported, it works for me. I can not reproduce the described issue.
- Set LOG_DEPRECATIONS_CHANNEL=stack in .env
- Cause exception in controller
- Revisit page
Result: The inertia error modal with error is shown.
If this is still an issue for you it would be great if you could provide a repo with a minimal reproduction. This will help to have a look at it.
Hey there,
We're closing this issue because it's inactive, already solved, old or not relevant anymore. Feel free to open up a new issue if you're still experiencing this problem.