Skip to content
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-js): NodejsFunction bundle fails when path contains a space #17631

Closed
jacob-swanson opened this issue Nov 22, 2021 · 1 comment · Fixed by #17632
Closed

(aws-lambda-js): NodejsFunction bundle fails when path contains a space #17631

jacob-swanson opened this issue Nov 22, 2021 · 1 comment · Fixed by #17632
Assignees
Labels
@aws-cdk/aws-lambda-nodejs bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@jacob-swanson
Copy link

What is the problem?

Running cdk deploy from a cdk project in a path that contains spaces results in an error.

Reproduction Steps

  1. Place cdk project using NodejsFunction in a directory that contains spaces.
  2. Run cdk deploy

What did you expect to happen?

Deploy to be successful.

What actually happened?

Deploy fails with the following:

cp: target 'spaces/cdk.out/bundling-temp-0dbd89a2a1ec500e5a64697c9bfaf0cdbb3e63c57ce92e0a24478173f9c94cf0/package-lock.json' is not a directory
/<redacted>/cdk with spaces/node_modules/@aws-cdk/core/lib/asset-staging.ts:398
      throw new Error(`Failed to bundle asset ${this.node.path}, bundle output is located at ${bundleErrorDir}: ${err}`);
Error: Failed to bundle asset <redacted>, bundle output is located at /<redacted>/cdk with spaces/cdk.out/bundling-temp-0dbd89a2a1ec500e5a64697c9bfaf0cdbb3e63c57ce92e0a24478173f9c94cf0-error: Error: bash -c npx --no-install esbuild --bundle "/<redacted>/cdk with spaces/<redacted>" --target=node14 --platform=node --outfile="/<redacted>/cdk with spaces/cdk.out/bundling-temp-0dbd89a2a1ec500e5a64697c9bfaf0cdbb3e63c57ce92e0a24478173f9c94cf0/index.js" --external:aws-sdk --external:node-fetch && echo '{"dependencies":{"node-fetch":"^2.6.6"}}' > /<redacted>/cdk with spaces/cdk.out/bundling-temp-0dbd89a2a1ec500e5a64697c9bfaf0cdbb3e63c57ce92e0a24478173f9c94cf0/package.json && cp /<redacted>/cdk with spaces/package-lock.json /<redacted>/cdk with spaces/cdk.out/bundling-temp-0dbd89a2a1ec500e5a64697c9bfaf0cdbb3e63c57ce92e0a24478173f9c94cf0/package-lock.json && cd /<redacted>/cdk with spaces/cdk.out/bundling-temp-0dbd89a2a1ec500e5a64697c9bfaf0cdbb3e63c57ce92e0a24478173f9c94cf0 && npm ci run in directory /<redacted>/cdk with spaces exited with status 1

CDK CLI Version

1.133.0 (build 2dea31a)

Framework Version

No response

Node.js Version

v16.11.1

OS

Fedora 35

Language

Typescript

Language Version

No response

Other information

Moving from cdk with spaces to cdk results in a successful build and deploy.
The failed command does not have quotes around the file paths to deal with spaces.

@jacob-swanson jacob-swanson added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 22, 2021
jogold added a commit to jogold/aws-cdk that referenced this issue Nov 22, 2021
…aining spaces

Encloses paths with double quotes (`"`).

Closes aws#17631
@peterwoodworth peterwoodworth added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Nov 22, 2021
@mergify mergify bot closed this as completed in #17632 Nov 30, 2021
mergify bot pushed a commit that referenced this issue Nov 30, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…aining spaces (#17632)

Enclose paths with double quotes (`"`).

Closes #17631


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

pedrosola pushed a commit to pedrosola/aws-cdk that referenced this issue Dec 1, 2021
…aining spaces (aws#17632)

Enclose paths with double quotes (`"`).

Closes aws#17631


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
…aining spaces (aws#17632)

Enclose paths with double quotes (`"`).

Closes aws#17631


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants