Rough idea of how to make your Node.js Lambda functions compatible with v2 and v3 SDKs.

Not terrible. Not great either.

gist.github.com/brianleroux/54

#aws #lambda #javascript #nodejs

The v3 SDK is pretty clearly designed to be used with webpack or something like it.

Problem is, using a bundler with Node.js is a bad practice if you care about meaningful errors. Which we do.

Ideally we didn't have bugs and errors in our code but planning for that to not happen is a bad plan ! Debugging without meaningful stack traces is terrible DX.

@brianleroux

Does node not have anything equivalent to source maps?

(Says someone who has no idea how to set up & use source maps properly...)

@AmeliaBR it does but it only got that functionality in the past year and it really does not work very well (if at all). Transpiling is maybe ok on the frontend where browsers have good source map support but even then I find it lacking compared to runtime native stack traces. Velocity is downstream ability to resolve bugs as well as adding features. IMO transpiling costs more in velocity than it gains.

@brianleroux @AmeliaBR Firefox source map / debug has been broken for years... (ex bugzilla.mozilla.org/show_bug. with full repo code)
And on a vendors own platform with their own SDK should be totally unnecessary.
I live by stack traces. Key debugging tool.

@falken @AmeliaBR at least there's options in browsers… when people do this to themselves in Node its baffling to me.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.