filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.28k stars 2.96k forks source link

FilamentAsset registered components not preserved between requests when using Octane #7211

Closed saulens22 closed 1 year ago

saulens22 commented 1 year ago

Package

filament/filament

Package Version

v3.0.0-beta10

Laravel Version

v10.16.0

Livewire Version

v3.0.0-beta.4

PHP Version

PHP 8.1

Problem description

When using Octane and adding Select form element, page loads correctly only once.

After that error is given: Alpine component with ID [select] not found for package [filament/forms]. Here's link to log output: https://flareapp.io/share/v5pBKG0P

Error occurs on this line: https://github.com/filamentphp/filament/blob/3e6bf1c7d8667b788d3bcae1aa1bc2a15b02e5c6/packages/forms/resources/views/components/select.blade.php#L74

Expected behavior

Page loads successfully every time.

Steps to reproduce

Example repository has simple example with autologin. Run / check launch.sh for instructions.

Reproduction repository

https://github.com/saulens22/laravel-playground/tree/filament-v3-roadrunner

Relevant log output

No response

saulens22 commented 1 year ago

Forgot to mention - I've already tried flushing some of the bindings, as per https://github.com/filamentphp/filament/pull/2055

https://github.com/saulens22/laravel-playground/blob/94eed8e4423441c4c0a3447bb1f980c4ff99113c/config/octane.php#L138-L150

danharrin commented 1 year ago

Duplicate of #7427. Please test the fix #7552

saulens22 commented 1 year ago

@danharrin I've tested the fix and found another problem - Livewire is not getting injected.

There is a fix in Livewire v3.0.0-beta.8 (link to fix) but filament/support got locked to v3.0.0-beta.7 in this commit: https://github.com/filamentphp/filament/commit/6bb89885c819d0e625feb3eb32260fac8a224e16

danharrin commented 1 year ago

We can upgrade to Livewire once they make a new release, they severely broke something else in the last release, causing us to lock the version

danharrin commented 1 year ago

Try requiring Livewire in your project with dev-main as v3.0.0-beta.7

saulens22 commented 1 year ago

It works that way. Thank you!