codesandbox / codesandbox/codesandbox-client
can't use top-level await in projects where you set es2020 or something
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.6k
- Forks
- 2.4k
- Avg merge
- 6d 19h
- Merged PRs (30d)
- 2
Description
🐛 bug report
Preflight Checklist
- I have read the [Contributing Guidelines][contributing] for this project.
- I agree to follow the [Code of Conduct][code_of_conduct] that this project
adheres to. - I have searched the issue tracker for an issue that matches the one I want
to file, without success.
Description of the problem
I can't use await
e.g. if you open the Browser console you can do something pointless like await console.log("HI") and it won't throw an error.
On Codesandbox you can't.
Similar to https://github.com/codesandbox/codesandbox-client/issues/8433 except that it's for top-level await.
To Reproduce
https://codesandbox.io/p/sandbox/hungry-forest-forked-3ssrkq?file=%2Fsrc%2Findex.ts
https://codesandbox.io/p/sandbox/codesandbox-github-async-await-issue-7hpwm8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure in the two linked CodeSandbox projects, especially the /src/index.ts example, and compare it with top-level await in a browser console. Trace how an ES2020 project is processed; done means top-level await works without an error in the affected sandbox configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100