[lambda-nodejs] Bundling a lambda_nodejs.NodejsFunction fails after upgrading to 1.58.0
See original GitHub issueIt 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (16 by maintainers)
Top Results From Across the Web
@aws-cdk/aws-lambda-nodejs - npm
This library provides constructs for Node.js Lambda functions. To use this module, you will need to have Docker installed. Node.js Function.
Read more >class NodejsFunction (construct) · AWS CDK
A Node.js Lambda function bundled using esbuild. Example. new lambda.NodejsFunction(this, 'my ...
Read more >aws-cdk.aws-lambda-nodejs - PyPI
This is useful when working with native dependencies or when esbuild fails to bundle a module. lambda_.NodejsFunction(self, "my-handler", bundling=lambda.
Read more >@aws-cdk/aws-lambda-nodejs | Yarn - Package Manager
The NodejsFunction construct creates a Lambda function with automatic transpiling and bundling of TypeScript or Javascript code.
Read more >AWS CDK - aws-lambda-nodejs Module (updated)
Lamba in CDK; aws-lambda-nodejs; Bundling; Benchmarking #1 ... faster cold starts when installing and bundling just a part of the aws-sdk.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@pgarbe in a GitHub Action you should try with Local bundling.
Closing for now. Reopen if 1.60.0 does not solve this