Replies: 1 comment
-
Remember that VSCode is not transforming nor executing the code, only performing static analysis via the language service.
You probably want to use our ESM loader. #1007 has instructions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a relatively straightforward typescript project, that's importing nodejs internal libraries, some yarn-installed JS modules and other typescript files. I'm trying to add dynamic import with top-level await to a file, and struggling to figure out the right tsconfig.
Example code:
The following two configurations are interesting:
"target": "es2019", "module": "commonjs"
:"target": "es2019", "module": "esnext"
:I did add
"type": "module"
topackage.json
, which seems to have no impact.Interestingly VSCode doesn't show an error in the editor with (2) config above, only ts-node does.
What am I missing? I'm on Node v15, using ts-node 9.1.1, typescript 4.2.4. Target is es2019 simply because that most closely matched features Node v15 actually supported, I can change versions of anything as needed.
Beta Was this translation helpful? Give feedback.
All reactions