Skip to content

[5.x] Getting 419 expired on livewire update call after updating statamic/cms to v5.73.8 #14053

@lauritsen

Description

@lauritsen

Bug description

Hi 🙂
I have an issue with getting 419 expired on the update call from livewire components. It seems to have been introduced in v5.73.8 of statamic/cms package. It only happens with static caching full. I see there is a change in replacing nocache regions for full measure. Not sure if I need to change something in my implementation or if there is a bug?
In the livewire payload I have _token: "STATAMIC_CSRF_TOKEN"
And livewire version is 3.7.10
Switching between statamic/cms 5.73.8 and 5.73.7 makes the issue appear/disappear.

edit: it happens for files that are exluded from static caching in exclusions in static_caching.php config

How to reproduce

To be fair, I did not try to reproduce in a fresh app, my assumption is the following.

  • Use statamic/cms v5.73.8
  • Use livewire/livewire v3.7.10 (version doesn't seem to matter)
  • Have a livewire component on a page that is excluded from static caching in static_caching.php config
  • Enable full measure static caching
  • Visit the page
  • The livewire update call will fail with 419, because it has the csrf token set to STATAMIC_CSRF_TOKEN

Logs

Environment

Environment
Application Name: My App
Laravel Version: 11.48.0
PHP Version: 8.3.17
Composer Version: 2.9.5
Environment: development
Debug Mode: OFF
URL: my-app.com
Maintenance Mode: OFF
Timezone: Europe/Zurich
Locale: en

Cache
Config: CACHED
Events: NOT CACHED
Routes: CACHED
Views: CACHED

Drivers
Broadcasting: null
Cache: redis
Database: mariadb
Logs: stack / daily, important, flare
Mail: mandrill
Queue: redis
Session: redis

Pulse
Enabled: ENABLED
Enabled: ENABLED
Version: v1.5.0
Version: v1.5.0

Livewire
Livewire: v3.7.10

Statamic
Addons: 15
Sites: 1
Stache Watcher: Disabled
Static Caching: full
Version: 5.73.8 PRO

Statamic Addons
justbetter/statamic-environment-permissions: 1.1.0
marcorieser/statamic-livewire: 3.9.0
mitydigital/feedamic: 2.5.0
mitydigital/statamic-scheduled-cache-invalidator: 2.2.1
rias/statamic-color-swatches: 2.3.1
rias/statamic-redirect: 3.14.1
stefangalescu/statamic-heroicons: 3.2
stillat/antlers-components: 2.6.0
studio1902/statamic-peak-browser-appearance: 3.6.1
studio1902/statamic-peak-seo: 8.26.2
studio1902/statamic-peak-tools: 6.7.1
swiftmade/statamic-clear-assets: 3.3.0
transformstudios/review: 5.2.0
visuellverstehen/statamic-classify: 3.2.0
webographen/statamic-admin-log: 1.1.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions