The Wire · Showcase
LIVEWIRE 3 JAVASCRIPT HOOKS EXAMPLE BROKEN IN BOOST DOCS
By RepoJournal · Filed · About Laravel
The official Livewire 3 failure handler example in Laravel Boost fires neither of its two hooks, leaving developers with dead code.
Suliman Benhalim just landed a fix that exposes a critical documentation problem [1]. The JS hooks example teaches two failure handlers, but neither one actually works in Livewire 3. The first handler wires up `message.failed`, which is a Livewire 2 lifecycle hook [2]. The upgrade guide lists it under deprecated hooks, folded into `commit` with the old body moving to a `fail()` callback. Nothing dispatches `message.failed` in v3, so that handler silently dies. The second handler has a different problem: it reads `fail.status` when `fail` is the callback registrar, not the failure object [2]. Both patterns look plausible enough to ship to production unnoticed. If you've copied this example into your Livewire 3 app, your error handling is likely incomplete.
One email a day. Unsubscribe in one click.
Keep up with Laravel in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review any Livewire 3 failure handlers copied from Boost docs before your next deploy laravel/boost [immediate]
- → Check the corrected example in PR #927 and update your lifecycle hooks laravel/boost [plan]
References
- [1] Fix the Livewire 3 JavaScript hook example so both failure handlers actually fire (#927) laravel/boost
- [2] Fix the JavaScript hook example in the Livewire 3 skill ↗ laravel/boost