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 with the Node.js debugger #1108

Closed
jantimon opened this issue Nov 14, 2016 · 13 comments
Closed

Debugging with the Node.js debugger #1108

jantimon opened this issue Nov 14, 2016 · 13 comments
Labels

Comments

@jantimon
Copy link

Is it possible to use debugger without purchasing Webstom?

Could you please add a receipt for iron-node or for node --inspect?

@sindresorhus
Copy link
Member

We have a short guide, but it's not currently working → #988. We plan on supporting the built-in Node.js devtools inspector at some point → #929.

@jantimon
Copy link
Author

jantimon commented Nov 14, 2016

Wow cool that works perfectly - just tested it with node 4 and iron-node.

I only had to reload (CMD+R) after iron-node started up

developer_tools_-_file____users_jnicklas__nodenv_versions_4_4_4_lib_node_modules_iron-node_app_index_html

@sindresorhus
Copy link
Member

Great. I'll keep this open for discovery until I have time to add something more visible.

@jsatk
Copy link

jsatk commented Jan 21, 2017

@sindresorhus I'd love the ability to use the node debugger. Mocha has this feature if you run mocha debug. I rely heavily on setting debugger statements in my code and test suite to, well, debug.

I'd love to contribute to AVA and add this feature in. Is anyone currently working on this? Please let me know if the AVA crew is open to someone adding the ability to use the native node debugger.

Thanks.

@sindresorhus
Copy link
Member

@jsatk No one is currently working on this. We would welcome a pull request :)

See #929 for the previous attempt. Especially #929 (comment).

@sindresorhus sindresorhus changed the title Debugging with iron-node Debugging with the Node.js debugger Jan 22, 2017
@sindresorhus sindresorhus added enhancement new functionality help wanted and removed question labels Jan 22, 2017
@jsatk
Copy link

jsatk commented Jan 23, 2017

@sindresorhus Thank you. Will take a peek and do it if I can. :)

@tony-kerz
Copy link

@jantimon can you help me out with the specific command-line/npm-script that you used to invoke iron-node against an ava test? i'm trying the following with ava 0.17.0, node 7.4.0 and iron-node 3.0.17:

iron-node node_modules/ava/profile.js test/ava

but getting:

screen shot 2017-01-29 at 10 18 30 am

@jantimon
Copy link
Author

jantimon commented Jan 29, 2017

iron-node node_modules/ava/profile.js test.js 

you might need to press cmd+r or ctrl+r

or just switch to https://facebook.github.io/jest/

@sindresorhus
Copy link
Member

@tony-kerz That command only works on one file, not a directory.

@tony-kerz
Copy link

thanks @jantimon and @sindresorhus, got iron-node working calling out a specific file 👍

also, plain-old babel-node kind of works with this:

babel-node --inspect --debug-brk node_modules/ava/profile.js test/ava/my-test.js

but dev-tools couldn't resolve the source-map for some reason.

it showed transpiled code, with this comment included:

//# sourceMappingURL=../../node_modules/.cache/ava/8777fd944b4d081b32c7a8708f7547a4.js.map

a project for another day, but any insight welcome...

thanks again!

@Qix-
Copy link
Contributor

Qix- commented Jun 28, 2017

Preferably AVA could have a command such as ava --inspect that would simply run node --inspect and then issue debugger; right before it runs the tests.

@sindresorhus
Copy link
Member

@Qix- Yup, that's the plan. #929 started work on it, but was never finished.

@novemberborn
Copy link
Member

Since this started out as a documentation request, I'm closing in favor of #1505.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants