While debugging node.js cli script in chrome dev tools (that is possible http://youtu.be/03qGA-GJXjI), I cannot save the changes I made on the fly like I can when I debug normal javascript from a website. I get an error message:
"Debugger.setScriptSource failed. LiveEdit Failure: Failed to compile new version of script: SyntaxError: Unexpected token ["
And then a warning:
Saving of live-edit changes back to source files is disabled by configuration. Change the option "saveLiveEdit" in config.json to enable this feature.
Does anyone know how to fix this? It would be really convenient to debug and edit file and save it while not leaving chrome dev tools.
Thanks.
btw, this is how the config.json looks like, https://github.com/node-inspector/node-inspector/blob/master/config.json. I tried changing "saveLiveEdit" option to true, but still I get the same message "Saving of live-edit changes back to source files is disabled by configuration. Change the option "saveLiveEdit" in config.json to enable this feature."
Using Google Chrome DevTools to Debug To start debugging, let's run our application with the --inspect-brk flag. The next step is to head to Chrome, open a new tab, and enter the URL chrome://inspect/ . Click on “Open dedicated DevTools for Node” to start debugging the application.
Press the F12 function key in the Chrome browser to launch the JavaScript debugger and then click "Scripts". Choose the JavaScript file on top and place the breakpoint to the debugger for the JavaScript code.
This seemed to work for me. I started 2 shells:
Then go to http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858 on your browser.
Making changes to your code should save it on the hard drive.
You can use the environment variable node-inspector_save-live-edit
and set it to true
. The environment variable node-inspector_
prefix is scanned by node-inspector.
You can also use $HOME/.node-inspectorrc and store the following:
{
"save-live-edit": true,
"preload": false,
"hidden": ["node_modules/" ],
"nodejs": ["--harmony"]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With