I have a V1 API backed lambda that I'm running wit...
# sst
r
I have a V1 API backed lambda that I'm running with
sst start
in VSC using debug but it's not hitting any breakpoints. What can I do to track down why?
j
Check if you are using
0.21.1
? There was a recent issue that was fixed. https://github.com/serverless-stack/serverless-stack/releases/tag/v0.21.1
r
I am, I'm an upgrade junkie
j
haha. Hmm what’s your
launch.json
look like?
r
Copy code
{
  "type": "node",
  "request": "launch",
  "name": "Launch SST",
  "runtimeVersion": "14.17.0",
  "runtimeExecutable": "npm",
  "runtimeArgs": [
    "start"
  ],
  "port": 9229,
  "skipFiles": [
    "<node_internals>/**"
  ],
  "env": {
    "EPSAGON_TOKEN": "blahblah"
  }
}
j
That looks right to me. Was this working for you before?
r
I've had it working on other projects
This is the first time working on this one
j
Oh that’s strange. When you invoke the endpoint, over on VS Code it shows a list of processes on the left side. Do you see sst spawning any child processes?
r
just firing it back up
Just
j
This seems very much like the issue we had that was fixed in 0.21.1
Hmm, I might need a repo to test this.
This is a Node.js Lambda function?
r
yeah
j
Oh I thought we fixed this 😅
Let me try testing this with API v1 and a Lambda.
r
great, thanks Jay
j
Hmm just tried it. It worked fine. Anything you could share about your setup?
r
I've just downgraded to 0.20.0 and I'm having the same issue
so maybe it's something in my env
j
So this bug was introduced in 0.19 and fixed in 0.21.1. Just make sure you are trying one of those.
r
I also have a weird thing where if I set
lint: false
in
sst.json
the last msg in the console when running
sst start
is Transpiling Lambda code...
j
Let me try that.
Hmm it seems fine for me. I think this is a sign that something is off.
It should end with this “Debug session started. Listening for requests...“.
f
@Jay I know what @Ross Coundon is talking about for the
lint: false
case
I’m actually fixing that right now
Did we figure out @Ross Coundon’s VSCode issue?
j
No, I think it might be related.
f
@Ross Coundon, when you set
lint: false
, do you not see the “Debug session started. Listening for requests...” line?
r
Nope
On the other thing, I've downgraded to 0.20.0 and I still can't hit breakpoints
Going to purge node_modules, package-lock and .build dirs and try again
j
So to be clear, the breakpoint issue is there in 0.20. It was fixed in 0.21.1. Make sure you try that.
r
ah, ok. I was on 21.1 when i noticed the problem and downgraded to 0.20 to see if it then worked. What version should I downgrade to get the last confirmed working version?
f
0.18.0
r
ok, 2 mins
what's the compatible version for the CDK packages for 0.18.0?
f
1.98.0
r
thanks
yeah, that hits the breakpoint
f
@Ross Coundon I just released v0.22.0 and it fixes a
lint: false
related bug. Maybe see if it fixes your issue by any chance.
If no luck, can you send me your
.build/sst-debug.log
when
sst start
gets stuck at “Transpiling Lambda code...” again?
r
That seems to be working, Frank. Let me do some more checks
f
Did the breakpoint also got hit?
r
Hi, yes, it was the breakpoint that started working. I haven't checked the lint option just yet. I did have an issue earlier where it stopped getting hit. I tried restarting the debug process but that didn't help. In the end I stopped debug, deleted .build folder and started debug again. It then started working again
I've pretty much been running the local debugger all day and that happened only once
f
When it stopped getting hit, did ur local code run and sent back a reponse? Or do you think ur code didn’t get run at all and the request failed?
r
The code didn't get run and the invocation timed out
f
I see… Let me know if you notice any pattern when it happens again. I will keep an eye on this too.
r
Certainly will, it had been rebuild an redeployed many many times, I guess it could be a resource leak somewhere but a hard one to pinpoint. I'll keep an eye out