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

Fix debugging with Webstorm on Node.js 8 #1414

Merged
merged 4 commits into from
Jun 25, 2017
Merged

Conversation

dohomi
Copy link
Contributor

@dohomi dohomi commented Jun 14, 2017

Description

On Node 8 Webstorm debug is not working any longer. The reason is, that the --inspect-brk is not handled correctly inside of the cli.js file

Error Message & Stack Trace

Starting inspector on 127.0.0.1:53733 failed: address already in use

Fix

Adding --inspect-brk to api.js

Environment

Node v8.1, latest AVAJS

add `--inspect-brk` for Webstorm debugging
@dohomi dohomi changed the title Update api.js Update api.js for debug Webstrom on NodeJS v8.x Jun 14, 2017
@novemberborn
Copy link
Member

Hey @dohomi, this looks good!

I pushed a commit which replaces these comparisons with a regular expression instead. That led me to trying to understand the existing API tests which seem to be limited and a bit confusing (notably --inspect-brk and --debug-brk aren't tested). So there's some commits that add / fix comments for that too.

Could you check whether --inspect-brk still works for you?

@sindresorhus happy with the regexes?

@sindresorhus sindresorhus changed the title Update api.js for debug Webstrom on NodeJS v8.x Fix debugging with Webstorm on Node.js 8 Jun 17, 2017
@sindresorhus
Copy link
Member

happy with the regexes?

👍

@dohomi
Copy link
Contributor Author

dohomi commented Jun 18, 2017

@novemberborn yes I think this is better a approach 👍

execArgv.some((arg, index) => {
const isDebugArg = arg === '--inspect' || arg.indexOf('--inspect=') === 0;
const isDebugArg = /^--inspect(-brk)?($|=)/.test(arg);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no --inspect-brk. Could you update t=your regex removing that validation, please?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@novemberborn novemberborn merged commit a868b02 into avajs:master Jun 25, 2017
@novemberborn
Copy link
Member

Thanks @dohomi!

@dohomi
Copy link
Contributor Author

dohomi commented Jun 26, 2017

Thanks for merging

kevva pushed a commit that referenced this pull request Sep 13, 2017
* Rename confusing `--debug-brk` in code comment
* Document curious test behavior around `--inspect` and `--debug` flags
* Match `--debug` and `--inspect` args with regular expressions
* Add `--inspect-brk` for Webstorm debugging
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

Successfully merging this pull request may close these issues.

4 participants