Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about top-level-await

Read more about top-level-await

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - top-level-await

Top level await not working in ECMAScript

I am rather confused as I have read that top level await is supported in ESM but when I try it out in a html file it does not work? Were I found that is says: Top-level await does not work with node 1...
test-img

Jalrux

javascript

async-await

es6-modules

top-level-await

Votes: 0

Answers: 1

Latest Answer

Yes, it's supported in ESM - ES6 modules. It's not supported in plain script tags. <script> await Promise.resolve(); </script> You need to specify that the script is a module for...
test-img

CertainPerformance

TS Jest won&#39;t accept top-level-awaits with NodeJS 16 &amp; TypeScript

I'm trying to update my NodeJS 12 & TypeScript app to Node16, one of the reasons is the need to use top-level-awaits. The code compiles correctly after the update, but Jest won't accept the specif...
test-img

galah92

node.js

typescript

jestjs

top-level-await

Votes: 0

Answers: 2

Latest Answer

After some research, I can certainly tell you that we are still far from a reliable solution. The main problem is that the top-level await is available when the 'module' option is set to 'es2022', 'e...
test-img

Marco Luzzara

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved