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

Add --auto-open flag w/ --inspect #12069

Closed
kentcdodds opened this issue Mar 27, 2017 · 11 comments
Closed

Add --auto-open flag w/ --inspect #12069

kentcdodds opened this issue Mar 27, 2017 · 11 comments
Labels
feature request Issues that request new features to be added to Node.js. inspector Issues and PRs related to the V8 inspector protocol

Comments

@kentcdodds
Copy link

Based on #7992, I'm filing this issue to start a discussion around supporting a flag that would open or refresh an inspect session. Because copying/pasting the URL is a suboptimal workflow. I believe there's a chrome extension that will basically do this, but it'd be really nice to have it supported natively.

@joyeecheung
Copy link
Member

joyeecheung commented Mar 27, 2017

Probably related: #11207 (If we decide to be vendor-neutral about the --inspect behavior...)

@joyeecheung joyeecheung added the inspector Issues and PRs related to the V8 inspector protocol label Mar 27, 2017
@jasnell
Copy link
Member

jasnell commented Mar 27, 2017

Just a thought, but perhaps this would be better suitable as a feature addition to node-inspect? That is, provide the ability to launch node-inspect with an option that opens a third-party debug client like Chrome as opposed to launching the command line debugger client.

example:

$ NODE_INSPECTOR=chrome node-inspect foo.js

@mscdex mscdex added the feature request Issues that request new features to be added to Node.js. label Mar 27, 2017
@cjihrig
Copy link
Contributor

cjihrig commented Mar 27, 2017

I don't think this is a good idea for core. We'd have to know how to start every set of supported debugging tools on every supported platform. It also wouldn't be very vendor neutral.

@kentcdodds
Copy link
Author

I tend to agree with @cjihrig and @jasnell. I would worry that this would bloat node unnecessarily. I would however like a blessed and official solution for this problem. Does such a solution exist?

@kentcdodds
Copy link
Author

I should say as a side note that the debugging story for node is definitely an area that needs work. Most people are still using console.log just because that's the path of least resistance. It's further complicated by the number of people using babel or TypeScript. If we could make the debugging story more straightforward, I think that would make things so much better for everyone.

@jasnell
Copy link
Member

jasnell commented Mar 27, 2017

Going with an environment variable approach where the value of the env var is required to include the launch pattern for the debugger would certainly provide a workable generic approach. e.g. NODE_INSPECTOR="chrome %u" where %u is replaced by the debugger URL on launch. It would be something that could be easily baked in to node-inspect without incurring the additional bloat of trying to teach it how to launch multiple tools

@Trott
Copy link
Member

Trott commented Jul 30, 2017

/cc @jkrems

@jkrems
Copy link
Contributor

jkrems commented Jul 30, 2017

Because copying/pasting the URL is a suboptimal workflow.

I totally agree - it's not a good workflow. I wish we wouldn't be printing those URLs. If you're using Chrome Devtools, you can just go to chrome://inspect, click "Open dedicated DevTools for Node", and it will do all the connecting & reconnecting for you. :) Unless you use highly dynamic ports & IPs, you shouldn't have to copy & paste the URL.

I say highly dynamic because as long as you have a limited set of IP+port combinations, you can use "Configure..." to register them on chrome://inspect. And from then on we're back to "no copy&paste required".

@kentcdodds
Copy link
Author

Thanks @jkrems. That's the best way to do things now. We can close this. For what it's worth, that workflow didn't exist when I filed this issue. Glad the workflow is much better now :)

@jkrems
Copy link
Contributor

jkrems commented Jul 31, 2017

@kentcdodds Sorry, didn't mean to imply that the ticket wasn't totally reasonable at the time. :)

@d668
Copy link

d668 commented Sep 20, 2017

Use Node.js V8 --inspector Manager (NiM) Chrome plugin, it opens Chrome automagically when I run node --inspect-brk app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

No branches or pull requests

8 participants