aws-cdk: [lambda-nodejs] Bundling a lambda_nodejs.NodejsFunction fails after upgrading to 1.58.0

It seems that there might be something wrong with generating ‘asset-output/index.js’.

This is the log I get from ‘yarn build’:

Run yarn build
yarn run v1.22.4
$ yarn test && yarn compile && yarn run package
$ yarn eslint && rm -fr lib/ && jest --passWithNoTests --updateSnapshot
$ eslint . --ext .ts
[eslint-import-resolver-typescript]: option `directory` is deprecated, please use `project` instead
Bundling asset testing-stack/ecr-scan-result-handler/handler/Code/Stage...
🚨 Build failed.
Error: Entry /asset-input/cdk-ecr-image-scan-handler/lambda-handler/handler.ts does not exist
Error: Entry /asset-input/cdk-ecr-image-scan-handler/lambda-handler/handler.ts does not exist
    at EntryResolver.resolveEntry (/node_modules/@parcel/core/lib/EntryResolver.js:44:13)
[Error: Invalid argument]
FAIL test/index.test.ts (127.674 s)
  ✕ Create EcrImageScanResultHandler (124115 ms)

  ● Create EcrImageScanResultHandler

    Failed to bundle asset testing-stack/ecr-scan-result-handler/handler/Code/Stage: Error: docker exited with status 1

I did not find very comprehensive examples about how to create this kind of reusable module with Typescript code bundled in an AWS Lambda. Please advise if there is a configuration error in the project.

Reproduction Steps

See the code at https://github.com/markusl/cdk-ecr-image-scan-handler and run ‘yarn build’

What did you expect to happen?

The code should be bundled as a JSII template.

What actually happened?

I received the error.

Environment

  • CLI Version : 1.58.0
  • Framework Version: 1.58.0
  • Node.js Version: v12.14.1
  • OS : Mac
  • Language (Version): TypeScript

Other


This is 🐛 Bug Report

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (16 by maintainers)

Most upvoted comments

@pgarbe in a GitHub Action you should try with Local bundling.

Closing for now. Reopen if 1.60.0 does not solve this

The fix for index.js is not included in 1.59.0, will be in the next release