-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-lambda-nodejs: spaces in path-name results in error #13210
Labels
@aws-cdk/aws-lambda-nodejs
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Comments
simon-dk
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Feb 23, 2021
jogold
added a commit
to jogold/aws-cdk
that referenced
this issue
Feb 24, 2021
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-lambda-nodejs
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Spaces in paths can break cdk synth when using @aws-cdk/aws-lambda-nodejs construct together with esbuild.
The resulting error is: "error: Must use "outdir" when there are multiple input files".
Sample repo
https://github.com/Simon-SDK/cdk_bug_report
Steps
Install repo and run "cdk synth".
Description
The error happens because of these two lines:
aws-cdk/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts
Line 143 in 296a10d
aws-cdk/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts
Line 146 in 296a10d
The output of the esbuildCommand returns un-escaped paths, making esbuild believe there are multiple files, example:
npx esbuild --bundle /.../cdk/lib/lambda function/index.ts --target=node12 --platform=node --outfile=/.../cdk/cdk.out/bundling-temp-d5ad4854b4c5ea5068744c5b1b87fe2b04eec6a7aae0e3bdd2928a97638d2e5f/index.js --external:aws-sdk
If the lambda folder in the sample repo is changed to "lambda_function", "cdk synth" runs fine.
What did you expect to happen?
Cdk synth should build a index.js using esbuild without crashing.
What actually happened?
esbuild crashes because it (wrongly) expects multiple input-files.
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: