Skip to content
Discussion options

You must be logged in to vote

Edit: Since Alpine v3 supports await in expressions, it can only be used in environments with async support. See discussion in comments.

Sure, this error is triggered by any expression actually. To reproduce, Alpine must be transpiled by a bundler that transforms async, e.g. esbuild with es2016 target.

Steps to reproduce

  1. Install Alpine.js and esbuild.
npm install alpinejs esbuild
  1. Create src.js.
import Alpine from "alpinejs";

Alpine.start();
  1. Bundle into dist.js.
./node_modules/.bin/esbuild --bundle src.js --outfile=dist.js --target=es2016
  1. Create minimal index.html.
<html>
  <head>
    <script defer src="dist.js"></script>
  </head>
  <body x-data="{}">
  </body>
</html>
  1. Open in…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@jayjun
Comment options

@danddanddand
Comment options

@jayjun
Comment options

@SimoTod
Comment options

SimoTod Nov 4, 2021
Collaborator

@jbosse
Comment options

Answer selected by jayjun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants