Top Level Await with nodemon #1886
angelhdzmultimedia
started this conversation in
General
Replies: 1 comment
-
Solved?Apparently, after reading massive number of solutions, I assumed I can run nodemon -e as a shorthand for --exec, and it was causing an error. It turned out -e is a shorthand for extension... Now I finally got Top Level Await working with the following script: |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Search Terms
Expected Behavior
Being able to use top level await in a node typescript project.
Actual Behavior
Tons of errors no matter what combination of tsconfig.json, package.json and compiler flags I try.
Other solutions
I tried one setup using nodemon and babel and it worked, but with ts-node or ts-node-dev I can't get it working
and my search history is huge! Can't find a solution.
Even a solution I left someone else in the past, isn't currently working!!!
The solution was:
nodemon -I --exec node --experimental-specifier-resolution=node --loader ts-node/esm ./src/main.ts
Please, help!!!
Steps to reproduce the problem
Minimal reproduction
Specifications
Operating system and version: Windows 10.0.19044 Build 19044
If Windows, are you using WSL or WSL2?:
Beta Was this translation helpful? Give feedback.
All reactions