I'm trying to follow the instructions given in the Livewire docs to set livewire component properties or call methods in javascript. However, I keep getting "Page has expired" alert on Chrome?
<script>
document.addEventListener('livewire:load', function () {
//These work:
console.log(Livewire.first().foo)
console.log(@this.foo)
// These give the "The page has expired " error and freeze the page:
Livewire.first().bar()
@this.bar()
Livewire.first().foo = 'Hello world'
})
</script>