Dirk Stewart
05/24/2021, 6:57 PMFrank
Frank
Dirk Stewart
05/24/2021, 8:59 PMDebugger attached.
and Sending keep-alive call
, it's just that the breakpoints aren't triggeredDirk Stewart
05/24/2021, 9:02 PMFrank
Frank
Frank
Dirk Stewart
05/24/2021, 9:11 PMnode --inspect
somehow and the other is proxying a debug connection somehow back to my machine?Dirk Stewart
05/24/2021, 9:11 PMJay
Jay
Jay
Jay
Jay
Dirk Stewart
05/24/2021, 9:16 PMDirk Stewart
05/24/2021, 9:18 PMJay
Dirk Stewart
05/24/2021, 9:25 PMDirk Stewart
05/24/2021, 9:27 PMDirk Stewart
05/24/2021, 9:27 PMJay
Dirk Stewart
05/25/2021, 7:21 PMlaunch.json
at https://docs.serverless-stack.com/debugging-with-vscode which includes "port": 9229
which can be removed.
The port
option is for situations where vscode is connecting to a remotely running node process. For example, you have some node code in a docker container and you want to debug it, obviously you can't have vscode "inside" the docker container, so you run node my-cool-app.js --inspect
in the container, which runs the program and also listens for debug connections on 9229, and back in your host you click debug, and vscode connects over port 9229 to establish a debug connection with that remote process
I think when I saw that I instantly thought "oh they do some cool reverse proxy thing with api gateway and get lambdas to run in --inspect
mode, when really I should have just RTFM 😅Dirk Stewart
05/25/2021, 7:22 PMJay
Dirk Stewart
05/25/2021, 8:18 PMDirk Stewart
05/25/2021, 10:10 PMDirk Stewart
05/25/2021, 10:12 PMDirk Stewart
05/25/2021, 10:20 PMlaunch.json
I set "trace":true
to get detailed information about the debugger process, the difference I can see between the two is:
• v0.13 has debug logs with the tag runtime.sourcecreate
for all built js files in .build/...
, and a bunch of Debugger.breakpointResolved
messages
• v0.21 only has runtime.sourcecreate
logs for the following files:
.build/eslint.js
.build/run.js
.build/lib/index.js
.build/eslint.js
• v0.21 doesn't have any ``Debugger.breakpointResolved`` logs
• In both cases .build/src/lambda.js
is there and looks perfectly fine
• Testing all the versions up from 0.13, the break appears to happen between 0.18 & 0.19
• Looking at the difference between the sst-debug.log files for 0.18 and 0.19, the only significant looking difference seems to be that cli/scripts/start.js:onClientMessage
reports [2021-05-26T00:26:18.336] [DEBUG] client - onClientMessage {"action":"server.clientRegistered","clientConnectionId":"f6IgFfS_LPECHAQ="}
in 0.18 (debugging working) and in 0.19 where debugging doesn't work there's no trace of a server.clientRegistered
message being received (however the code in both cases runs, and I get the "Hello, World! Your request was received at 25/May/20212326:41 +0000." message returned to my browser)
• @Jay @Frank I'm clocking off for the evening but let me know if anything springs to mind from the aboveJay
Frank
Frank
$ npm install --save --save-exact @serverless-stack/cli@0.21.1 @serverless-stack/resources@0.21.1
Dirk Stewart
05/26/2021, 5:57 AM