sst start is crashing with ```TypeError: Cannot re...
# help
m
sst start is crashing with
Copy code
TypeError: Cannot read property 'type' of undefined
    at returnLambdaResponse (/Users/mike/shoplifted-apps/auto-tags/node_modules/@serverless-stack/cli/scripts/start.js:1128:24)
    at ChildProcess.<anonymous> (/Users/mike/shoplifted-apps/auto-tags/node_modules/@serverless-stack/cli/scripts/start.js:1165:5)
    at ChildProcess.emit (events.js:315:20)
    at ChildProcess.EventEmitter.emit (domain.js:483:12)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
This is happening in live lambda dev. It happens inside an iframe as a shopify app. If I hit the same endpoint outside of the iframe it works. If I deploy the api it also works. Only fails in live lambda.
f
Hmm.. looking at the stack trace.. it seems invoking local function failed
I’m going to add more debug logging around that part of the code and then cut a release. And you can give it a try with the new version, and send me the debug log.
p
I also have a situation where I get this same problem, for a specific function. I haven't been able to cut it down to a small test yet though
Seems like it's more likely to happen with larger return payloads. 10k+ chars seems to do the trick
m
@Frank sorry I missed you earlier. Yeah so it's only failing when using live lambda. "lambdaResponse". Running it deployed it works.
Copy code
if (lambdaResponse.type === "timeout") {
...
}

// lambdaResponse is undefined
More debugging would be cool. That's the hard part!
f
Yeah what @Pål Brattberg suggested could be the cause. The websocket API in the debug stack has a limit of 32KB per package.
I will cut a release later today with more debugging
m
Interesting.
Sounds good. Thanks again.
f
@Mike McCall @Pål Brattberg The issue should be fix in v0.9.12 (also added detailed debug messages in case it pops up again)
To update:
Copy code
$ npm install --save --save-exact @serverless-stack/cli@0.9.12 @serverless-stack/resources@0.9.12
Mike, let me know if this fixes ur issue.
p
Awesome! This at least fixes my trouble, thanks @Frank!
m
@Frank thanks, I’ll give it a go shortly!
@Frank this seems to have fixed the issue. Thanks.
f
Nice!
m
This is actually still happening for me.
f
Can you send me the debug log in
.build/sst-debug.log
m
yup one sec.
f
Yup, DM me.
We need to redact the debug log to remove sensitive info from there.
Btw, the debug log get cleared out at the beginning of every sst command. So I would need the file before u run
sst start
again or other sst commands.