SDK consumers using an older esbuild version for bundling results in a runtime error #6814
peter-at-work
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When AWS recently dropped support for node v16 starting with v3.723.0, the @aws-sdk/client-s3 package (and potentially other clients) has more efficient code, like static class initializers.
For example, the cjs module for
S3ExpressIdentityCache.ts
(v3.723.0+) contains the following:An older version of the esbuild bundler would incorrectly generate code for static initializers like:
Usage of the
xs
variable in the generated bundle is incorrect, and would exhibit a runtime error:This has been fixed in esbuild v0.21.2 or later https://github.com/evanw/esbuild/releases/tag/v0.21.2 to generate code like:
If you had been using an older version of esbuild for bundling, as described at https://aws.amazon.com/blogs/compute/optimizing-node-js-dependencies-in-aws-lambda/, then make sure you upgrade to v0.21.2 or later version of esbuild.
Beta Was this translation helpful? Give feedback.
All reactions