Closed brandonkal closed 3 years ago
Top Level Await is not supported in TypeScript 3.7. We are temporarily getting past this by ignoring the error, but internally TypeScript is not tracking the types right, because it thinks you have invalid syntax.
What version of tsc
are you using?
3.7.2
Interesting though this doesn't appear to be related to the await
thing. Wrapping the whole thing in an async function, Deno still spits out the same TS compile errors.
@brandonkal what does your tsc
config look like?
https://github.com/brandonkal/deno-lib/blob/master/tsconfig.json
Maybe I've got something odd going on in my environment. I'm seeing the effect of "strictNullChecks" but now looking at my tsconfig, it is not specified there.
I have axetroy.vscode-deno
installed.
@brandonkal you can't run tsc
based on the tsconfig.json
and have your example compile. Could you please provide an example where tsc
successfully compiles?
@kitsonk PTAL if this issue is still relevant
This was always an external issue, and there was outstanding information requested that was outstanding. Closing due to inaction.
See https://gist.github.com/brandonkal/853c3d1dc53a79d366b6662eaa84bb5f
Details of the bug are contained in the Gist file.
Pinging @kitsonk as he is the TypeScript expert here.
To reproduce, run the file and notice that Deno throws bad TypeScript errors.
tsc
correctly infers the type of the parameters.