Uncaught (in promise) ReferenceError: handler is not defined #1878
Unanswered
ajtrichards
asked this question in
1. Help
Replies: 2 comments 2 replies
-
You need to have a single element as direct child to template. |
Beta Was this translation helpful? Give feedback.
1 reply
-
The script also needs to be deferred so that the listener is registered before the Alpine script runs. If you move the listener above your code it will work too. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All.
I'm new to using Alpine JS so apologies if I've missed something really basic!
Alpine JS Version
I'm using version 3.2.2 from CDN JS
Problem
I have the following HTML code:
This is the JavaScript I'm using:
When I run this in the browser I keep getting a message
Uncaught (in promise) ReferenceError: handler is not defined
. I think get further messages to sayfields
isn't defined.I've added this in Codepen to see if I can get it running but I get the same messages in the console.
https://codepen.io/ajtrichards/pen/LYymVNq
Any help would be appreciated :)
Thanks,
Alex
Beta Was this translation helpful? Give feedback.
All reactions