Problem:
When we change AWS lambda to nodejs20.x runtime - we start to get Uncaught Exception when we use encrypt function - after a big effort I figured out it came from a package stream-shift which uses a private field of the buffer. An issue has occurred on node 20.11.0, which affects the functionality of the lambda.
You are exposed to these uses because you depend on https://www.npmjs.com/package/duplexify version 4.1.1
Solution:
Update duplexify to version 4.1.3 which already fixes the version of stream-shift