I’ve just been setting up a new project with Trellis + Sage, just following the documentation so far without adding anything custom, but as soon as I add the simple livewire example in the documentation—specifically, as soon as I add the @livewireScripts
directive, my app crashes with the error “Route [livewire.update] not defined.”
To reproduce:
trellis-cli 1.13.0
to set up the projectenabled: true
underSSL
key indevelopment/wordpress_sites.yml
- in the
themes
directory,composer create-project roots/sage my-theme-name
(I ran this command yesterday, andtheme.json
confirms Sage 11.0.0 - in the new theme directory,
composer require livewire/livewire
, which I can see isv3.6.1
- finally, I’ve just followed the remaining steps on this page exactly, so won’t reprint it all here, but in short that is rendering the
@livewireScripts
directive in the WP hooks, usingwp acorn
to create a new Livewire component, and then using it with<livewire:post-list />
on a page (in my caseindex.blade.php
)
After building, I visit the site homepage locally and get Symfony\Component\Routing\Exception\RouteNotFoundException
with message Route [livewire.update] not defined.
Running wp acorn route:list
confirms that Acorn does have five routes registered:
GET|HEAD livewire/livewire.js
GET|HEAD livewire/livewire.min.js.map
GET|HEAD livewire/preview-file/{filename}
POST livewire/update
POST livewire/upload-file
I’ve added nothing beyond this, and am quite stuck figuring out why the route wouldn’t be defined. Any help or pointers much appreciated.