cms
cms copied to clipboard
StaticCaching\Replacers breaks Inertia Links
Bug description
This PR #6231 breaks our Inertia adapter, we use on multiple websites.
Statamic\StaticCaching\Replacers\CsrfTokenReplacer::prepareResponseToCache():Argument 1 ($response) must be of type Illuminate\Http\Response, Illuminate\Http\JsonResponse given, called in /var/www/html/vendor/statamic/cms/src/StaticCaching/Middleware/Cache.php on line 62
How to reproduce
I'll provide an example repo - if necessary.
Logs
No response
Environment
Laravel Version: 9.24.0
PHP Version: 8.1.6
Composer Version: 2.3.5
Addons: 0
Version: 3.3.27 PRO
Installation
Existing Laravel app
Antlers Parser
regex (default)
Additional details
No response
Thank you for the report. I see the issue but I'm curious what the adapter usage looks like. A repo would be helpful, thanks.
@jasonvarga
It seems like that is more a problem with how inertia works and not with the implementation (https://inertiajs.com/the-protocol).
However, you can see the adapter implementation here: https://github.com/tobiasthaden/flattens-inertia.
We'll disable the static cache and handle this within the mentioned adapter.
I would prefer if there is a possibility to opt-in to new features – especially on a patch release.