Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Code extension complaint about top-level await #484

Closed
win-t opened this issue Aug 4, 2021 · 3 comments
Closed

VS Code extension complaint about top-level await #484

win-t opened this issue Aug 4, 2021 · 3 comments

Comments

@win-t
Copy link

win-t commented Aug 4, 2021

Describe the bug
VS Code extension complains about top-level await

To Reproduce
Following code will produce problem in visual code

// file: main.ts
export const sleep = (ms: number) => new Promise((ok) => setTimeout(ok, ms));

await sleep(1000);

console.log("hello world");

but, it works well when I run deno run main.ts

Expected behavior
No error

Screenshots

image
image

Versions

vscode: 1.58.2 deno: 1.12.2 extension: 3.7.0

@win-t
Copy link
Author

win-t commented Aug 4, 2021

and also, it complains about not being a esmodule without import or export statement
image

@win-t
Copy link
Author

win-t commented Aug 4, 2021

Wow, It works now after I restart VS Code, 🤔

@win-t win-t closed this as completed Aug 4, 2021
@kitsonk
Copy link
Contributor

kitsonk commented Aug 4, 2021

Probably caused by what #474 fixed but hasn't been released yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants