Skip to content

esbuild compatibility #57

@drernie

Description

@drernie

30717 (lambda-nodejs): breaking change in esbuild causes import module error

Overview: ESBuild released a breaking change on version 0.22.0 that
          changed the default bundling behavior. `lambda-nodejs`'s
          `NodeJsFunction` now to fails to synthesize with the error
          message `Runtime.ImportModuleError: Cannot find module
          'module'`. This issue exists on all CDK versions up to and
          including `2.147.2`. The workaround is either pin the
          esbuild version to ~0.21 or add `--packages=bundle` to
          `bundling.esbuildArgs` property (this option only works for
          esbuild version >= `0.22.0`).

Affected versions: aws-cdk-lib.aws_lambda_nodejs.: >=2.0.0 <= 2.147.2

More information at: https://github.com/aws/aws-cdk/issues/30717

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions