top-level-await Questions

4

Solved

I have spent an hour now searching for a solution to a new error after needing top-level await. Everything else I have tried so far did not solve the error such as adding "type": "mo...
Dullish asked 30/10, 2020 at 14:39

2

Solved

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 spe...
Reggy asked 15/1, 2022 at 20:13

1

I'm studying Typescript and running into a problem. I want to use the import and top-level await but currently, I can only use one at a time. Here is my config in tsconfig.json which allows me to u...
Successive asked 13/2, 2022 at 9:17

2

Solved

I have node 14.13.0, and even with --harmony-top-level-await, top-level await is not working. $ cat i.js const l = await Promise.new(r => r("foo")) console.log(l) $ node -v v14.13.0 ...
Angelitaangell asked 26/11, 2020 at 8:8

3

Solved

Top-level await support was added to Node.js in 14.3.0 via --experimental-top-level-await and later to --harmony-top-level-await. The Problem I need to use a top level await in my ESM script file, ...
Fruit asked 3/11, 2020 at 20:54
1

© 2022 - 2024 — McMap. All rights reserved.