On Windows 10 I put together very simple node Express app:
investigate-debugger
+--.vscode
+-- launch.json
+-- app.js
+-- index.html
+-- program.js
Server started with app.js code:
//////////////////app.js
var express = require('express');
var app = express();
app.use(express.static('.'));
app.listen(8080, function () {
console.log('Example app listening on port 8080!');
});
index.html just loads the program.js file:
//////////////////index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
<script src="program.js"></script>
</head>
<body>
</body>
</html>
//////////////////program.js
var x = 5;
var y = 4; // here is “Breakpoint ignored because generated code not found”
console.log(5 + 4);
I have configured launch.js in the following way:
{
"version": "0.2.0",
"configurations": [
{
"name": "Chrome, launch",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8080",
"webRoot": "${workspaceRoot}",
"diagnosticLogging": false,
"sourceMaps": false,
"userDataDir": "${workspaceRoot}/.vscode/chrome"
}
]
}
When I run debugger, I see the output 9 in the debugger console, I see the browser opened in the correct path and yet breakpoint does not work in the program.js, line 2:
What did I wrong here?
