-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use tsx to avoid loader deprecation #208
Comments
As the warning suggests, you should replace the --loader ts-node/esm flag with the one suggested in the warning, and the warning will disappear. FWIW there's an open issue on the ts-node repo to allow users to use a simpler syntax: TypeStrong/ts-node#2072 |
To make the command more ergonomic, create a file that registers module resolution hooks. Let’s name the file register.js.
Then use the --import flag to import the file.
Add to npm
|
if this benefits others, i advise to try tsx instead of ts-node. Either run directly tsx file.ts or with '--import', 'tsx' arguments. |
Obsoleted by #213 |
(node:32333) ExperimentalWarning:
--experimental-loader
may be removed in the future; instead useregister()
:--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("ts-node/esm", pathToFileURL("./"));'
(Use
node --trace-warnings ...
to show where the warning was created)The text was updated successfully, but these errors were encountered: