Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CDK Pipelines: NodejsFunction not working #28026

Open
rix0rrr opened this issue Nov 16, 2023 · 3 comments
Open

CDK Pipelines: NodejsFunction not working #28026

rix0rrr opened this issue Nov 16, 2023 · 3 comments
Labels
@aws-cdk/pipelines CDK Pipelines library bug This issue is a bug. p1

Comments

@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 16, 2023

Describe the bug

When using NodejsFunction along with a CDK pipeline, the lambda fn's code is being packaged with an empty zip and is being uploaded.

Expected Behavior

A non-empty ZIP is uploaded

Current Behavior

An empty ZIP is uploaded

Reproduction Steps

Replication code - https://github.com/mrlikl/node-js-lambda

Possible Solution

Quick update on this, while looking a similar issue where tarball was not being uploaded, came across this GH issue.

Every stage of the pipeline has a separate folder inside cdk.out however the assets are present at the root of cdk.out.

Additional Information/Context

No response

CDK CLI Version

Framework Version

No response

Node.js Version

OS

Language

TypeScript

Language Version

No response

Other information

No response

@rix0rrr rix0rrr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 16, 2023
@github-actions github-actions bot added the @aws-cdk/pipelines CDK Pipelines library label Nov 16, 2023
@rix0rrr rix0rrr added the p1 label Nov 16, 2023
@pahud pahud removed the needs-triage This issue or PR still needs to be triaged. label Nov 16, 2023
@mrlikl
Copy link
Contributor

mrlikl commented Nov 17, 2023

Is this related - cdklabs/cdk-stacksets#258 ?

@jolo-dev
Copy link
Contributor

jolo-dev commented Nov 18, 2023

@rix0rrr have you tried

import * as path from 'path'

instead of yours here
https://github.com/mrlikl/node-js-lambda/blob/6953e5c32af4d88744eb8206b0f4d2d1cc0049af/lib/lambda-stack.ts#L5

I have successfully used CDK pipelines with NodeJS Functions in my previous projects.

@mbergkvist
Copy link

Is this related - cdklabs/cdk-stacksets#258 ?

Not sure if it is related, but I've added comment on some more findings and updated the replication code, if that can help.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
@aws-cdk/pipelines CDK Pipelines library bug This issue is a bug. p1
Projects
None yet
Development

No branches or pull requests

5 participants