Regression in x-init behavior since v3.14.4 with Laravel/Livewire integration #4453
Unanswered
danyderigon
asked this question in
5. Bugs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Since updating Alpine.js to version
3.14.4
(released two days ago), I have noticed a breaking change in the behavior of thex-init
directive when used in combination with Laravel and Livewire. This issue was not present in version3.14.3
.Steps to reproduce
wire:key
in the markup to trigger re-renders:Expected behavior
In version
3.14.3
and earlier, each time the Livewire component re-renders, thewire:key
changes, the<div>
is regenerated, andx-init
is executed again. This logsHello World
to the console on every re-render, which is crucial for re-initializing JavaScript-dependent components (charts, viewers, etc.).Observed behavior
Starting with version
3.14.4
, thex-init
directive no longer re-executes after a Livewire re-render. This causes major issues in my project because components that depend on JavaScript initialization (like charts or custom viewers) are not being properly re-initialized.Environment details
Additional context
Due to infrastructure constraints, we are currently on an older version of Laravel and PHP. Despite this, the issue seems specific to changes introduced in Alpine.js
3.14.4
, as downgrading to3.14.3
resolves the problem.This regression significantly impacts our ability to use Alpine.js in conjunction with Livewire for dynamic components. Please investigate and let me know if there are any workarounds or upcoming fixes.
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions