Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Fzoltan87's avatar

Livewire + AlpineJS - showButton is not defined

Hello, I have built a small LMS where users can create courses and add episodes to them. The episode playback is designed so that when an episode is watched, a button appears indicating that the video has been viewed. Clicking this button automatically loads the next episode and records in the database which episodes the user has already watched.

However, after watching the first episode and clicking the button, I get the following error message in the console:

Alpine Expression Error: showButton is not defined

Expression: "showButton"

<button class="mt-4 p-2 bg-green-500 text-white rounded" x-show="showButton" wire:click="confirmWatched">

Uncaught ReferenceError: showButton is not defined

What could be the issue? I appreciate any responses.

Projekt

  • Laravel 11
  • Livewire 3.5
  • AlpineJs 3.4.2

EpisodePlayer.php

episode-player.blade.php

0 likes
0 replies

Please or to participate in this conversation.