Debugging wishlist

I’ve just discovered https://serverless.com/framework/docs/providers/aws/cli-reference/invoke-local/#invoke-local which should be linked from https://github.com/serverless/serverless/issues/281 & their should be a topic called debug upon https://serverless.com/framework/docs/ referring to this.

But frustratingly what local invoking doesn’t do, is stepping through your code and inspect variables etc etc. That to me seems sorely missing. :sob:

Furthermore I find that especially once deployed to production, it’s VERY handy to have copies of the input event.json to re-run / re-create / reproduce issues locally in development. Short of developing this functionality everytime I write a lambda function, could there be some trick I am missing?

If you want production to save copies of the input event for each request you can simply log the event to Cloud Watch.

console.log("Event", event);

Then you can copy the event from Cloud Watch to event.json to test locally.

1 Like

True, thanks for the tip. Though would be nice if there was some convenience function since copy/pastes can be fiddly.

Btw, what about a “debugging JS” story? :slight_smile: