Skip to content
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

Inspect not working #1191

Closed
andrewjmead opened this issue Dec 22, 2017 · 2 comments
Closed

Inspect not working #1191

andrewjmead opened this issue Dec 22, 2017 · 2 comments

Comments

@andrewjmead
Copy link

  • nodemon -v: 1.14.2
  • node -v: 9.2.0
  • Operating system/terminal environment: macOS
  • Command you ran: nodemon inspect app.js

Expected behaviour

I was expecting to see the same behavior as seen in v1.12.3 where it open the node inspect as if I ran node inspect app.js:

Here's the command and output from v1.12.3:

Andrew:~/Downloads/t$ nodemon inspect app.js
[nodemon] 1.12.3
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node inspect app.js`
< Debugger listening on ws://127.0.0.1:9229/83b5b113-cf01-4597-97a8-86eb351f91b3
< For help see https://nodejs.org/en/docs/inspector
< Debugger attached.
Break on start in app.js:1
> 1 (function (exports, require, module, __filename, __dirname) { let name = 'Andrew'
  2 debugger
  3 console.log(name)

Actual behaviour

The program executes normally and doesn't pause for debugging. Here's the output when using the same command on v1.14.2:

Andrew:~/Downloads/t$ nodemon inspect app.js
[nodemon] 1.14.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node inspect app.js`
Andrew
[nodemon] clean exit - waiting for changes before restart

Steps to reproduce

Create a simple script like the following and run the command above.

// app.js
let name = 'Andrew'
debugger
console.log(name)

If applicable, please append the --dump flag on your command and include the output here **ensuring to remove any sensitive/personal details or tokens.

@remy
Copy link
Owner

remy commented Dec 22, 2017

You might be the last person using inspect for the REPL based debugger (over using --inspect)!

Can you raise a PR to fix this? I'm pretty sure it's because nodemon uses fork instead of spawn which I think is required to get node inspect … to work.

remy added a commit that referenced this issue Dec 22, 2017
Fixes #1191

See new tests for details
@remy
Copy link
Owner

remy commented Dec 22, 2017

(please note - the PR that's linked to this issue is actually for a completely different issue - I just made a mistake in the commit message and github has linked them together).

remy added a commit that referenced this issue Dec 28, 2017
remy added a commit that referenced this issue Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants