question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
jogoldcommented, Aug 31, 2020

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

1reaction
eladbcommented, Aug 19, 2020

Closing for now. Reopen if 1.60.0 does not solve this

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found