Add a debug option
See original GitHub issueFeature Request
Is your feature request related to a problem? Please describe.
I’m trying to debug my probot application using node --inspect-brk=<port> ./node_modules/.bin/probot run ./index.js
so I can debug it, but I keep getting the same error:
Debugger listening on ws://127.0.0.1:36149/18493de3-209f-4b8e-af61-58745c77a878
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Starting inspector on 127.0.0.1:36149 failed: address already in use
Waiting for the debugger to disconnect...
Killed: 9
Even though nothing else is running, so the port is not already in use (tried multiple ports)
Describe the solution you’d like Documentation on how to debug, or a command line flag can be of great help here.
Describe alternatives you’ve considered I can run a debugger when running the jest tests, so that’s an option atm. but I would prefer to have a legitimate option to run the app and debug it while using real webhooks from GitHub.
Teachability, Documentation, Adoption, Migration Strategy Either make the default node method work:
node --inspect-brk=<port> ./node_modules/.bin/probot run ./index.js
or add a flag for running the bot:
npx probot run ./index.js --debug=33444
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
@JasonEtco did you try and attach a breakpoint in your
index.js
file?I can enter the probot code itself in debug mode with the line you wrote, but I can’t debug
index.js
since when the program’s process is opened, the child process tries to use the same port address. This fails because the probot process debugger already runs on the port selected, and the child process can’t attach a new debugger on the same port.That’s why I think it’s related to the issue I linked in my first comment.
I just stepped into the same issue and the workaround mentioned here worked for me. Use
--inspect=0
option then connect to the second debugger port, which should be linked to probot process: