Using Top Level Await with TypeScript #1441
Answered
by
kdy1
justsharan
asked this question in
Q&A
-
Title says it all... I'm trying to use top-level await with TypeScript, but I keep getting this error:
My {
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"decorators": true,
"dynamicImport": true,
"topLevelAwait": true
}
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
kdy1
Feb 28, 2021
Replies: 1 comment 2 replies
-
You need to set I verified that the following {
"jsc": {
"parser": {
"syntax": "typescript"
},
"target": "es2017"
}
}
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
kdy1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to set
jsc.target
to es2017 or upper.I verified that the following
.swcrc
allows top-level awaits.