I am running a Node application using:
node --inspect index.js
Opening devtools for node in Chrome then shows the main index.js's source as it is, but the rest of the scripts are garbled, like this:
(function (exports, require, module, __filename, __dirname) { "use strict";
var __cov_E6kz_9bK33ltizHRV1BcVA = (Function('return this'))();
if (!__cov_E6kz_9bK33ltizHRV1BcVA.__coverage__) { __cov_E6kz_9bK33ltizHRV1BcVA.__coverage__ = {}; }
__cov_E6kz_9bK33ltizHRV1BcVA = __cov_E6kz_9bK33ltizHRV1BcVA.__coverage__;
(....)
The files are not uglified (only babelified with gulp) and the debugger shows the path correctly:
As you can see, there is a path shown for the file routes/index.js... and the ‘route’ that chrome shows points to the correct /dist/ file... but the contents in my disk are different. Pretty printing the script in devtools shows a script with a ton of extra lines:
As you can see, the file in the left is the script on disk on the route shown in the first screenshot... and on the right is the same script as the first screenshot, but pretty-printed by devtools.
The app is a Kraken app packaged with gulp, I think Node is the one messing with the source, but I have never seen this. Has anyone encountered this? Is there a way to get the 'correct' source to debug?