I am using alpinejs to sometimes code directly on html when things are small and simple. I noticed that if I use an arrow function the console gives me an error (async function) and stops executing code, but it works if I use a regular function.
I think it’s something in the webpack config (I am importing alpinejs as vendor).
Of course, arrow functions work as expected when inside the js or a script tag.
I didn’t find anything on the alpinejs or webpack github though
Uncaught SyntaxError: Invalid or unexpected token
at new AsyncFunction (<anonymous>)
at 705.239c6c.js:2:4888
at 705.239c6c.js:2:5046
at 705.239c6c.js:2:5065
at W (705.239c6c.js:2:5358)
at H (705.239c6c.js:2:4470)
at V (705.239c6c.js:2:4425)
at 705.239c6c.js:2:34135
at Function.<anonymous> (705.239c6c.js:2:14737)
at s (705.239c6c.js:2:8877)