Closed tpfau closed 2 years ago
Hi @tpfau I believe the issue is that you're trying to use await
outside an async
function.
If you would wrap your script as:
(async function futureTest1 () {
let server = await vertx
.createHttpServer()
.requestHandler(req => {
})
.listen(0);
console.log('Server Ready!');
})();
I think it would work. The error message is comming from graal and indeed is not very descriptive
Thanks, That was indeed the issue. Might be good to put the example in an async function then. Should I just put in a PR with your suggestion as an update for the docs?
Please do! Thanks!
Hi, I'm currently having a problem (likely me not understanding Javascript again) with the
await
keyword in es4x code. If I take the example from here:and simply put this into my index.js and try to run it with es4x index.js, it fails with:
As I said, likely me screwing up javascript again, but a hint would be great.