Skip to content

Commit f90a1b1

Browse files
authored
Merge pull request #594 from indrora/patch-1
lambda-js: Add note about esbuild module exports
2 parents 2796786 + 5ca5c97 commit f90a1b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/docs/getting-started/lambda/lambda-js.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ The AWS managed Lambda layer for ADOT JavaScript provides a plug and play user e
1919

2020
The Lambda layer supports Node.JS v14+ Lambda runtimes. For more information about supported JavaScript and Node.JS versions, see the [OpenTelemetry JavaScript documentation](https://github.com/open-telemetry/opentelemetry-js).
2121

22+
For *TypeScript users*, if you are using `esbuild` (either directly or through tools such as the AWS CDK), you *must* export your handler function through `module.exports` rather than with the `export` keyword! The AWS mananaged layer for ADOT JavaScript needs to hot-patch your handler at runtime, but can't because `esbuild` makes your handler immutable when using the `export` keyword.
23+
2224
### Add the ARN of the Lambda Layer
2325

2426
In this section, we consume the Lambda layer for use with Node.JS Lambda Functions. This includes a reduced version of the [AWS Distro for OpenTelemetry Collector (ADOT Collector)](https://github.com/aws-observability/aws-otel-collector), which runs as a Lambda extension.

0 commit comments

Comments
 (0)