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

Debugging gulp and using child_process.fork #3

Open
cliffmeyers opened this issue Apr 26, 2017 · 3 comments
Open

Debugging gulp and using child_process.fork #3

cliffmeyers opened this issue Apr 26, 2017 · 3 comments

Comments

@cliffmeyers
Copy link
Contributor

I have the need to debug some of our Gulp-based builds, and we use gulp-runner to execute them. It seems difficult to debug the downstream gulp build because of the use of child.spawn here:

https://github.com/jonjaques/gulp-runner/blob/master/index.js#L36

I haven't found a way to get node into debug mode when child.spawn is used. I was curious if anyone is aware of a way to do this?

I've experimented with changing gulp-runner to use child_process.fork and debugging will work fine, as long as the parent process isn't also set to debug mode. This is due to a Node.js issue and unfortunately the fix for it hasn't landed yet:
bug: nodejs/node#9435
pull: nodejs/node#5025

I was curious if a PR would be accepted that would add two configuration parameters - perhaps debug=true/false and debugPort=number - which when active would change gulp-runner behavior to use child_process.fork instead?

@cliffmeyers
Copy link
Contributor Author

cc @jonjaques

@jonjaques
Copy link
Owner

Hey @cliffmeyers, I have no objection to that! Checkout #5 for how I would like to capture those options. Bonus points if you have any tips for how to run the process w/ fork. 😄

@cliffmeyers
Copy link
Contributor Author

@jonjaques yep, I've been fiddling with this the past day or so and finding it a little fickle when run from the test harness. Seems to work fine in my own environment though. I'll check out what you've got and get back to you.

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