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

TerrePorter's avatar

wire:poll not firing at all

Hey,

So I made a very basic page to test this as I am having problems on the main content with the wire:poll not working. New Laravel 10 install and Livewire 3.

Here are my files for this test.

Route

Route::get('/testpage', function () {
    return view('testpage_livewire_loader');
});

testpage_livewire_loader

@extends('layouts.app')

@section('content')
    @livewire('test-page')
@endsection

livewire TestPage component

namespace App\Livewire;

use Livewire\Component;

class TestPage extends Component
{
    public $testVal = 'start';

    public function render()
    {
        return view('livewire.test-page');
    }

    public function check_for_updates() {
        $this->testVal = rand(0,100);
    }
}

Livewire test-page template

<div>
    <div wire:poll="check_for_updates">
        <div class="text-red-700">
        {{ $testVal }}
        </div>
    </div>
</div>

The page starts off with the value set as "start" so it is loading the livewire component without error. However, it never does any type of HTTP call and it's been sitting there for a long time.

Am I missing something?

0 likes
14 replies
LaryAI's avatar
Level 58

It seems that the wire:poll directive is not firing in your Livewire component. Here are a few things you can check to resolve the issue:

  1. Make sure you have included the Livewire JavaScript library in your layout file. Add the following code just before the closing </body> tag in your layouts/app.blade.php file:
@livewireScripts
  1. Ensure that you have installed the Livewire package and its dependencies correctly. Run the following command in your terminal:
composer require livewire/livewire
  1. Check if the Livewire JavaScript assets are being loaded correctly. Inspect the page source and verify that the following script tags are present:
<script src="{{ mix('js/app.js') }}"></script>
@livewireScripts
  1. Verify that you have included the Livewire CSS assets in your layout file. Add the following code within the <head> section of your layouts/app.blade.php file:
@livewireStyles
  1. Make sure you have started the Livewire polling feature. In your TestPage component, add the poll method to the mount lifecycle hook:
public function mount()
{
    $this->poll();
}
  1. Check if there are any JavaScript errors in the browser console. Open the developer tools in your browser and look for any error messages related to Livewire.

If the issue persists, please provide more information about your Laravel and Livewire versions, as well as any error messages you encounter.

TerrePorter's avatar

Ok, Mr. AI...

Method App\Livewire\TestPage::poll does not exist.

and

laravel/framework : 10.21.0
livewire/livewire: 3.0.1

There are no error messages. And yes the style and script tags are in the layout page.

webrobert's avatar

I suspect it’s the method name. Try removing the underscores

public functionz checkForUpdates()

Snapey's avatar

ignore Lary's post 100%. He is clearly not across Livewire3

TerrePorter's avatar

@Snapey I figured it was something like that, but Lary has actually helped me in the past and well, I like being sarcastic to it - lol.

ModestasV's avatar

Just out of curiosity - Are you using Breeze? If so, please check the console log in your browser.

If it has an Alpine error, go into resources/js/app.js and remove everything that's related to Alpine :)

If it does not - then something else is off...

TerrePorter's avatar

@ModestasV That file is rather [insert word for really hard to read] but i think i was able to find the part about alpine and remove it but nothing changed. I also did a composer update, and npm update just incase some thing changed there. Still no change on the page.

TerrePorter's avatar

I just tried something else, I added a button to do a wire click and that also doesn't work.

It there something I need to do for Livewire to work? or is it supposed to work out of the box with no other changes?

TerrePorter's avatar

OK, mark this down for Id10T error aka "user error" It appears that my layout.app file somehow changed from livewireScripts to livewireScriptConfig and I didn't notice. So fixing that and everything works again.

TerrePorter's avatar

Another oddity, just for incase anyone else runs into the problem...

The docs for Livewire says it includes its own version of alpine.js, but the default Laravel 10 install also includes a version of alpine.js.

// resources/js/app.js
import Alpine from 'alpinejs';

window.Alpine = Alpine;

Alpine.start();

I started getting a weird error, "Uncaught (in promise) TypeError: l is not a function". It turned out that alpine was loading twice and I guess one of the versions didn't have the function "l" (lowercase L). After removing the Laravel 10 version of alpine.js the page loads without error.

I don't remember being told to remove the Laravel 10 alpine reference in the docs, just that Livewire included alpine.js and i didn't need to include it as a script tag

Snapey's avatar

@TerrePorter This is what @modestasv was advising to do.

Obviously whether you need to do this depends if you installed the framework before the breeze/livewire 3 release.

And you should not need to specify LivewireScripts or LivewireStyles at all.

1 like
ModestasV's avatar

@Snapey Yep, this is exactly what I advised to remove!

Just don't forget to build your assets after removal (npm run build) and you will be good to go :)

Please or to participate in this conversation.