Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StaticCaching\Replacers breaks Inertia Links #6475

Closed
tobiasthaden opened this issue Aug 10, 2022 · 3 comments
Closed

StaticCaching\Replacers breaks Inertia Links #6475

tobiasthaden opened this issue Aug 10, 2022 · 3 comments

Comments

@tobiasthaden
Copy link

tobiasthaden commented Aug 10, 2022

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

@jasonvarga
Copy link
Member

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.

@tobiasthaden
Copy link
Author

@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.

@tobiasthaden
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants