question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

debug-wise args are not honored

See original GitHub issue
  • nodemon -v: 1.14.12
  • node -v: 8.9.4
  • ts-node -v: 4.1.0
  • Operating system/terminal environment: Windows 10 x64
  • Command you ran:

nodemon with the following nodemon.json:

{
    "verbose": true,
    "watch": [
        "src"
    ],
    "ext": "ts",
    "exec": "{{pwd}}/node_modules/.bin/ts-node ./src/index.ts --project ./tsconfig.development.json --inspect=5858 --inspect-brk"
}

Expected behaviour

--inspect=5858 --inspect-brk are passed to node and one can connect with debugger

Actual behaviour

--inspect=5858 --inspect-brk are not passed to node and one can’t connect with debugger

terminal output:

[nodemon] 1.14.12
[nodemon] reading config .\nodemon.json
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 22156 to restart
[nodemon] watching: C:\Dev\node-typescript-vscode\src/**/*
[nodemon] watching extensions: ts
[nodemon] starting `C:\Dev\node-typescript-vscode/node_modules/.bin/ts-node ./src/index.ts --project ./tsconfig.development.json --inspect=5858 --inspect-brk`
[nodemon] spawning
[nodemon] child pid: 11272
[nodemon] watching 2 files

Steps to reproduce

  1. clone https://github.com/deilan-issues-samples/ts-node-issue-531
  2. yarn install or npm install
  3. yarn run serve:debug or npm run serve:debug
  4. launch Attach to nodemon VS Code debug configuration

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
blakeembreycommented, Feb 19, 2018

Closing with https://github.com/TypeStrong/ts-node/pull/536. I recommend node -r ts-node/register for all advanced node.js use-cases and flags.

2reactions
iangregsondevcommented, Feb 10, 2018

Ok, I think i have a workaround

You can execute it like this

node --inspect-brk=5858 --require ts-node/register ./src/index.ts

so you can create your nodemon.json file and do this, (create multiple nodemon.json files if you like - I have 1 for inspect and 1 for inspect-brk)

{
  "watch": ["src"],
  "ext": "ts",
  "ignore": ["src/**/*.spec.ts"],
  "exec": "node --inspect-brk=5858 --require ts-node/register ./src/index.ts"
}

Hope that helps.

So this trick here is not to run ts-node direct but to load via node.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Devise ignoring custom strategy - ruby on rails - Stack Overflow
I get no errors in my log. Everything seems to work ok. If I add "cheap debugging" aka a bunch of puts statements,...
Read more >
2019 R1 (SPx) issues - PC-DMIS User Forum
Starting a new thread listing issues found in PC-DMIS 2019 R1 (SPx). Each issue will be listed per post, not several in one...
Read more >
Macos Podman Minikube setup, Ended with errors connecting ...
I'm hoping someone can point me in the right direction debug wise? podman machine init (vars are derived from the system info calculated...
Read more >
How to use CD4052B analog mux to read from UART ports?
I'm using ESP32 with the ESP-IDF framework. I want to read power data from 3 HLW8032 IC. Modbus and GPS already use my...
Read more >
the end of LCD-hacks? | Details | Hackaday.io
Debug-wise, whenever new EPG info is downloaded, it shows an update, but does *not* show the info. It's taken a bit of experimenting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found