aerni / statamic-livewire-forms

Supercharge your Statamic forms with Livewire
https://statamic.com/addons/aerni/livewire-forms
Other
28 stars 2 forks source link

Undocumented step required when using livewire:scriptConfig tag #52

Closed godismyjudge95 closed 4 months ago

godismyjudge95 commented 4 months ago

Found out the hard way that if you need to compile the Livewire assets separately (ie. to add an Alpine plugin) there is one additional step required.

I had assumed that by using the {{ livewire:scriptConfig }} tag the livewire forms script would be included. However that appears to only set up some preliminary config variables.

I was able to get the forms working again by adding the following to by site.js:

import { Livewire, Alpine } from "../../vendor/livewire/livewire/dist/livewire.esm";
import "../../vendor/aerni/livewire-forms/resources/dist/js/livewire-forms";

window.Alpine = Alpine;
Livewire.start();
aerni commented 4 months ago

Thanks for taking the time to figure this out. I just merged your PR.