-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 with WebStorm" recipe vs latest WebStorm 2018.1.2 #1787
Comments
From reading earlier discussion I thought I might ping @develar -- hope that's not too presumptuous of me. |
Is there any reason you can't configure AVA in the I don't use WebStorm so I don't fully understand the options you're laying out here, but if you find a satisfactory approach we'd greatly appreciate any improvements to the recipe. |
Thanks for the quick follow-up! Yes, I would prefer to keep AVA config in But the way I understand things currently, I can either follow the "Setup using Node.js" section in the recipe, which doesn't use NPM (and thus doesn't look at Perhaps there is no better way to do this, but this situation isn't ideal. If I'm missing something obvious that'd be great. Either way, I think the recipe could be improved (slightly or significantly, depending on what I find out). I guess I'll wait to see if any WebStorm expert chimes in here, and take it from there? As mentioned, there isn't much urgency for me: I can continue developing just fine, it's just not very pretty as it is now. |
It sounds like you have config like |
I will try that but expect it won’t make a difference — I don’t think webstorm even looks at |
All right, thanks for the suggestion! I've tried with all AVA config in toplevel object in |
Either should just be an invocation of |
Ah! I see, hadn't thought that far ahead, thanks for clearing that up. Perhaps I should have been more explicit though in my original post here, the issue isn't that it doesn't run AVA -- it does -- but that it doesn't break at my breakpoints unless I change "scripts": { "test": "ava" } To "scripts": { "test": "node $NODE_DEBUG_OPTION node_modules/.bin/ava" } This works but it's ugly, imho. But given that AVA itself inspects the |
That's not customizable. We do have logic (contributed by @develar) that forwards appropriate |
Thanks again for your quick reply @novemberborn. It has to be I did notice the logic you mention, was actually thinking of making a PR on top of that to merge in stuff from this env var if present. But I hesitate, on the one hand because I don't really grok all that is going on there (or more accurately I would have thought it should work differently than what I see there). And on the other hand it'd be addressing this issue for ava specifically when actually it affects every npm script I might want to debug from WebStorm. I am currently thinking about patching my |
Ah yes, sorry. This code still reads from |
Yeah, so I guess the point there is that some of the Regarding WebStorm I’m inclined to give up — they apparently make a point of fixing their own debug port and make it available via that I found two methods but both have to be done separately for each package script I might wish to debug (the one I mentioned earlier which is to insert the env var into I think the other issue you linked won’t (can’t) help with having to figure out which port WS picked for a given run. |
It doesn't need to be pretty. We just need to explain how to make it work. Would you be interested in updating the recipe?
Let's not hack the
The way I understand it #1505 could make AVA recognize Node.js' |
I’ll give updating the recipe a try, sure. The debug port forwarding is not going to work — if I understand things properly. But maybe I don’t :-) |
Everything else requires code changes in AVA, which are tracked in #1505. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm interested in working on this and have WebStorm. Any idea if this is still an issue? Sample code to try with? (new to contributing so sorry if these are covered elsewhere) |
@cameronts I suppose try writing and debugging a test with WebStorm, following our documentation. If it works, then we can close this. And otherwise you could do a PR with improvements to the docs. |
Thanks will do |
@erikkemperman I'm trying to reproduce, have my project set up but.. wondering if you still have your old webStorm project files for this issue. Would save some time.. |
Description
Trying to follow this recipe in latest WebStorm, 2018.1.2. It appears as though JetBrains are now doing some internal cleverness around debug ports and perhaps the recipe ought to reflect this.
The section "Setup using Node.js" works as advertised, although it appears the
--debug-brk
or--inspect-brk
Node options in the "Edit configurations" dialog no longer have to be explicitly provided by the user (although it doesn't hurt if I do, it simply replaces my option with its own along with its port).The section "Setup using NPM" however does not work as advertised. To get things to work I have to change my
package.json
fromto
Otherwise it just runs the tests and doesn't break at my breakpoints.
Furthermore, I now have to remove any explicit
--debug-brk
or--inspect-brk
in the "Edit configurations" dialog or things just get stuck. The$NODE_DEBUG_OPTION
environment var is populated by WebStorm to--debug-brk=[port] --expose_debug_as=v8debug
on older Nodes and--inspect-brk=[port]
on later versions.So I have two ways to proceed, but neither is ideal. I can debug with Node.js but then I have to duplicate AVA arguments from my
package.json
into the run configuration in WS, or otherwise I can debug with NPM but then I have to add WS-specifics to mypackage.json
(and roundabout way of pointing at node_modules/.bin/ava).I'm not sure if this is something that should be addressed by JetBrains or AVA (or at all) but figured I'd report here first due to the advertised recipe.
Environment
node.js v9.8.0
npm 5.6.0
darwin 17.5.0
ava 0.25.0 (but tried also 1.0.0-beta4 with same results)
The text was updated successfully, but these errors were encountered: