microsoft / TypeScript Public
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
Provide a specialized error on top-level await and --module node12 #46149
Comments
I thought |
|
Proposed new error messages would be similar to:
Is there a situation to suggest Is the same applicable for this message too?
Changed to:
|
I believe that unless you're using |
This is the current check for the message. (moduleKind !== ModuleKind.ES2022 && moduleKind !== ModuleKind.ESNext && moduleKind !== ModuleKind.System && !(moduleKind === ModuleKind.NodeNext && getSourceFileOfNode(node).impliedNodeFormat === ModuleKind.ESNext)) || languageVersion < ScriptTarget.ES2017 So if someone is using Based on the current error message, My understanding is
I'm not sure if you meant the export const enum ScriptTarget {
ES3 = 0,
ES5 = 1,
ES2015 = 2,
ES2016 = 3,
ES2017 = 4,
ES2018 = 5,
ES2019 = 6,
ES2020 = 7,
ES2021 = 8,
ESNext = 99,
JSON = 100,
Latest = ESNext,
} This is really confusing indeed. |
TLA is actually allowed in only in esm mode |
Under
node12
, a top-level await results inThis error message has too much text. We should consider specializing these cases for
The text was updated successfully, but these errors were encountered: