I recently updated my lambda Node.js runtime from 8.x to 12.x. I upgraded lots of dependencies and optimized the bundling with webpack and the deployment process. BUT, I started to notice sporadic errors in Cloudwatch with a cryptic message "Unknown application error occurred" with no stack trace or any other log that could give me some context about the function input. There is no way for me to debug this code, and it appears to be a native AWS error that cannot even invoke the function for some reason, otherwise, there would be a JS stack trace attached to the log...
I'm starting to think there is a Webpack issue, but I even disabled the minification process so I have no clue where to look.
My code is 100% Typescript compiled using Webpack & Babel. Should I try removing Webpack from the build process and just zip the Typescript compiler output with the plain node_modules folder and no bundling whatsoever?
Can someone please help me? This function is in production!
EDIT: I see a bunch of warnings like DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead., and I am aware of, but it should not be the cause of this cryptic error.

