statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
3.7k stars 508 forks source link

The Stacks interop is breaking our Livewire application #10258

Closed riasvdv closed 3 months ago

riasvdv commented 3 months ago

Bug description

When updating to Statamic 5.6.0 or above, the new stacks feature is breaking our application by seemingly duplicating pushes to a stack.

How to reproduce

I can't find a quick way to reproduce this in a fresh install, but it is fixed when I comment this line: https://github.com/statamic/cms/pull/10200/files#diff-50384293468ae2833f9f413d6eb9e8b6d61e4ec7534ca6c683a0b6170c849d13R132

Looks like @jbreuer95 also ran into this https://github.com/statamic/cms/pull/10200#issuecomment-2141505070

Logs

No response

Environment

Environment
Application Name: Mailcoach
Laravel Version: 11.9.2
PHP Version: 8.3.4
Composer Version: 2.7.1
Environment: local
Debug Mode: ENABLED
URL: mailcoach.app.test
Maintenance Mode: OFF

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

Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: stack / daily, flare
Mail: log
Octane: frankenphp
Queue: sync
Session: database

Filament
Packages: filament, forms, notifications, support, tables
Version: v3.2.78
Views: NOT PUBLISHED

Pulse
Enabled: ENABLED
Version: 1.x-dev

Livewire
Livewire: v3.5.0

Statamic
Addons: 2
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.6.0 PRO

Statamic Addons
rias/statamic-redirect: 3.7.1
statamic/seo-pro: 6.0.2

Installation

Existing Laravel app

Additional details

No response

AntonCooper commented 3 months ago

Broke our app too

JohnathonKoster commented 3 months ago

On the pages that broke, do you have more details on how the views are structured/loaded? Are they regular routes or Statamic routes?

Trying to reproduce this on my end to get a fix going.

Edit: I can reproduce this now by using a Blade template and a Blade layout together. If anyone else can confirm that is also their setup that would be appreciated!

lakkes-ra commented 3 months ago

I guess that's also the reason for https://github.com/statamic/cms/issues/10273. It broke the Mailcoach Livewire Components, too. Getting the error "Uncaught Component already registered"

riasvdv commented 3 months ago

@JohnathonKoster The PR fixes our issue 👍