-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Using "ts-node" instead of "node" by default for ts files breaks the "--inspect" flag #1565
Comments
This is related to #1564. I don't use typescript at all, so you'll need to walk me through this. What is it in your command (assuming you're using node and not nodemon): |
This happens for me with node 10.15. If a launch a file ending with .ts in vscode, nodemon attempts to use ts-node instead of node. But vscode appends --inspect-brk arg:
Our workaround was to edit the vscode launch config and override nodemon's default file mapping to force node to be used (last two lines):
|
Open question: should nodemon drop the (newly added) default mapping for Or is there another solution? |
Is it just |
Adding my use case, this is my command: nodemon --inspect=0.0.0.0:9229 --exec 'ts-node src/index.ts' Which outputs:
I did have some luck with the following: nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register src/index.ts' Which attaches the debugger as expected. Seems like more of an issue with ts-node than with nodemon itself. I'm also having issues with breakpoints matching up with the lines, but that's definitely not a nodemon issue. |
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
Hi @remy. Thanks for your work on nodemon! I'd prefer to have the option to specify exactly which modules node will require. I think it would be reasonable to automatically add |
I don't use typescript at all, so you'll need to get a PR in with some
consensus if this makes sense.
…On Thu, 6 Jun 2019, 15:39 taye, ***@***.***> wrote:
Hi @remy <https://github.com/remy>. Thanks for your work on nodemon!
I'd prefer to have the option to specify exactly which modules node will
require.
I think it would be reasonable to automatically add --require
ts-node/register for .ts files only if no --require args are provided to
nodemon. This would make nodemon easier to use with typescript files, but
without getting in the way of more customised setups.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1565?email_source=notifications&email_token=AAADLBDBCEJXKFM6X5JBFTDPZEORNA5CNFSM4HLB2PQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXDB2OQ#issuecomment-499522874>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAADLBBZ6HGMAEVCZOIBSOTPZEORNANCNFSM4HLB2PQQ>
.
|
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
boop
|
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
worked for me |
Another option is using "nodemonConfig": {
"execMap": {
"ts": "node --require ts-node/register/transpile-only"
}
} Now |
works great! |
2022 and it helped me!!! |
nodemon -v
: 1.19.0node -v
: 12.0nodemon --inspect=0.0.0.0:9229 -r tsconfig-paths/register -r ts-node/register/type-check ./src/main.ts
Expected behaviour
The
--inspect
flag correctly passed to thenode
executable.Actual behaviour
The
--inspect
flag passed to thets-node
executable butts-node
doesn't support that flag.Created from PR #1552 (comment)
The text was updated successfully, but these errors were encountered: