Debug ES6 Node.js application with babel-node

I have some tests jestfor my application. Other sources jsused in the tests are recorded in js ES6Flow. My goal is to debug the sources used in the tests. However, when I debug them, the code is in rewritten / reduced form.

I tried the following:

  • ./node_modules/.bin/babel-node debug ./node_modules/.bin/jest --runInBandbut the files are still minimized (I have .babelrcwith es2015and stage-3presets)
  • ./node_modules/.bin/babel-node --debug ./node_modules/jest-cli/bin/jest.js --runInBandbut it freezes after launch jest
  • babel-node-debugsources are displayed correctly, but complete before debugging (error described here )
  • babel-nodewith presets on the command line, but he thought the presets were modules (a Error: Cannot find module *path*/es2015,stage-3similar error with the space between them)
  • node-inspectora babel-node debug. It shows the sources correctly, but it will not allow me to debug (the same error as above).
  • ./node_modules/.bin/babel-node ./node_modules/bugger/bin/bugger.js -b ./node_modules/jest-cli/bin/jest.js --runInBand(using buggerand babel-node- freezes after startupjest

My suggestion

babel-nodecreates the appropriate source maps, but the command line debugger cannot read them, and the GUI tools somehow do not work. How to check it?

My environment:

Node v6.0.0 jest v12.0.2 (dev dependency) babel 5.8.38 (babel-core 5.8.38) (dev dependency)

Desired Results

Ultimately, I would like to debug my files in chrome dev tools, but I would not complain about the command line debugger.

I hesitate to install even more magical tools that I don’t know how to use, but I would be happy to know why, if I need to.


I'm new to the whole js stack, so forgive me for my silly questions!

+4
1

SO- vscode debug ES6 application" , VS ES6/ES2015. , .

0

All Articles