-
Notifications
You must be signed in to change notification settings - Fork 121
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
Add esm
to ts-node
flags
#312
Comments
Just ran into the same issue, any known workaround? |
Just adding esm flag here won't work (it is not an ts-node API option which is used by this package), need to dig a bit deeper on how to make ESM work correctly. Doesn't |
Running
or
Returns
|
Install esm loader package. |
Hi, @wclr! https://typestrong.org/ts-node/docs/options#esm
|
Is there any update about this method?
|
Any updates? |
I was able to get it working with ts-node and nodemon. I can't yet speak for the speed, but it works: npm i typescript ts-node nodemon -D
# this one worked first, but there's a warning about using experimental features
nodemon -I --exec node --experimental-specifier-resolution=node --loader ts-node/esm ./src/main.ts
# then I got this one to work, a bit shorter and easier to read, no warnings
nodemon --exec ts-node --esm -r dotenv/config src/index.ts This was taken from this thread: #314 |
you can try https://github.com/esbuild-kit/tsx , it using esbuild, handle file extention (no need |
I can report that npm i tsx -D
tsx watch ./src/main.ts |
You are a life saver my friend, spent the last 4 hours on this |
This change replaces ts-node-dev with tsx. Note that tsx can't watch arbitrary files, so changes to the local .env no longer restart the server. Refs #1750 wclr/ts-node-dev#312, privatenumber/tsx#181
I'm trying to run
I'm getting this message
ts-node-dev/src/bin.ts
Line 11 in 32bdc92
The text was updated successfully, but these errors were encountered: