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

UNKNOWN error when trying to use NodejsFunction #7683

Closed
NightWatchman opened this issue Apr 29, 2020 · 7 comments
Closed

UNKNOWN error when trying to use NodejsFunction #7683

NightWatchman opened this issue Apr 29, 2020 · 7 comments
Assignees
Labels
@aws-cdk/aws-lambda-nodejs bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@NightWatchman
Copy link

NightWatchman commented Apr 29, 2020

Every time I try to use new NodejsFunction I get a spawnSync error that seems to be related to aws-lambda-nodejs not being able to succesfully execute the parcel command, but I can't figure out exactly why. Running the parcel command manually works fine.

Reproduction steps

Run the cdk deploy command

Error Log

Error: Failed to build file at C:\Developer\My.Project\stacks\api\requests\put-ad\put-ad-states\base64-decode-lambda\index.ts: Error: spawnSync C:\Developer\My.Project\node_modules\parcel-bundler\bin\cli.js UNKNOWN

at Builder.build (C:\Developer\My.Project\node_modules@aws-cdk\aws-lambda-nodejs\lib\builder.ts:107:17)
at new NodejsFunction (C:\Developer\My.Project\node_modules@aws-cdk\aws-lambda-nodejs\lib\function.ts:98:13)
at R.pipe.aws_stepfunctions_1.Task.task (C:\Developer\My.Project\stacks\api\requests\put-ad\put-ad-states\state-machine.ts:24:12)
at C:\Developer\My.Project\node_modules\ramda\src\internal_pipe.js:3:27
at C:\Developer\My.Project\node_modules\ramda\src\internal_pipe.js:3:27
at C:\Developer\My.Project\node_modules\ramda\src\internal_arity.js:11:19
at Object.exports.submitAdStateMachine (C:\Developer\My.Project\stacks\api\requests\put-ad\put-ad-states\state-machine.ts:103:21)
at new DigiknowApp (C:\Developer\My.Project\bin\app.ts:43:48)
at Object. (C:\Developer\My.Project\bin\app.ts:61:1)

Environment

  • CLI Version: aws-cli/1.16.307 Python/3.6.0 Windows/10 botocore/1.13.43
  • Framework Version: 1.36.0
  • OS: Windows 10
  • Language: en-us

Other

Running the command .\node_modules\.bin\parcel build C:\Developer\My.Project\stacks\api\requests\put-ad\put-ad-states\base64-decode-lambda\index.ts --out-dir .build --out-file index.js --global handler --target node --bundle-node-modules --log-level 2 --no-minify manually builds the file with no issues


This is 🐛 Bug Report

@NightWatchman NightWatchman added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 29, 2020
@jogold
Copy link
Contributor

jogold commented Apr 29, 2020

Seems from the stack trace that the error comes from ramda? Do you still see the error when removing this dependency? Can you share a reproductible example?

@SomayaB SomayaB added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. @aws-cdk/aws-lambda-nodejs labels Apr 30, 2020
@NightWatchman
Copy link
Author

I'll look into it more and see if I can come up with a minimal project that reproduces it.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 6, 2020
@eladb
Copy link
Contributor

eladb commented May 7, 2020

Closing for now

@eladb eladb closed this as completed May 7, 2020
@d2kx
Copy link

d2kx commented May 8, 2020

Same problem here, with all release up to 1.38.0

image

Only on Windows 10, works with with WSL2.

@jogold
Copy link
Contributor

jogold commented May 8, 2020

You need docker with v1.38.0.

@d2kx
Copy link

d2kx commented May 8, 2020

Thank you. That also does not work

image

Docker is asking for an absolute path but getting a relative one it looks like, but I'll try to look into it and file another new issue later.

Not sure I'll want to have Docker installed just for this library, so I'll likely switch back to the regular @aws-cdk/aws-lambda library and build the function myself in the future.

@jogold
Copy link
Contributor

jogold commented May 22, 2020

The problem on Windows should be fixed with #8140.

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.
Projects
None yet
Development

No branches or pull requests

5 participants