I crashed SST’s live debug :flushed: ```main ist: ...
# sst
s
I crashed SST’s live debug 😳
Copy code
main ist: [Function (anonymous)]

TypeError: Cannot read property 'length' of undefined
    at Object.truncate (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/cli/lib/object.js:7:17)
    at printLambdaResponse (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/cli/scripts/start.js:1540:58)
    at ChildProcess.<anonymous> (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/cli/scripts/start.js:1455:5)
    at ChildProcess.emit (events.js:376:20)
    at ChildProcess.emit (domain.js:470:12)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
a
Welcome to the club.
a
lol! 😂
a
I’m close to get rid of API GW v2.
It stops working suddenly.
It’s driving me crazy.
Spent so many hours, the logs on the lambda just cut suddenly.
a
damn! that’s worrisome, I have never faced any outages before.
a
It’s not outage, somehow it’s not working fine.
And I can’t find what’s the problem.
Maybe my region?
a
oh, which region are you using?
a
ap-southeast-1
a
It’s one of the most performant regions, I don’t think this is a service issue. There might be something off with your stack.
a
😞
f
@Sam Hulick, taking a look at the crashing issue
s
@Frank pretty sure it’s my mistake. I’m doing dumb things right now w/ the handler because I’m stuck trying to figure some stuff out
f
Sam, could it be your lambda returned
undefined
?
s
that, or it’s returning something that’s not a function
f
s
@Frank I suppose I should’ve asked before the PR.. but would it be possible to print a message out, like “Expected function, received <type> instead” ?
f
A Lambda handler can technically return any primitive types, arrays, objects, etc. Except a function callback 😂
Which is what caused the crash.
s
oh.. hmm. I think I was in a confused stupor last night or something 😄 I mean
export const handler = …
. that has to be a function, no? if you `export const handler = 'yo!`’, AWS can’t execute that