aws-cdk: @aws-cdk/aws-lambda-nodejs doesn't give useful error messages when builds fail.
We’re looking at switching over from Serverless to CDK for deploying our lambdas to minimise size. One of the things that Serverless does that I don’t know how to do cleanly in CDK is excluding devDependencies from the final built package that gets zipped / uploaded.
How do I go about configuring this behaviour in CDK?
This is a 📕 documentation issue
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (9 by maintainers)
Commits related to this issue
- fix(lambda-nodejs): no parcel error message when build fails Parcel outputs its error message to `stdout` not `stderr`. Also refactored tests to isolate tests on the `build` function. Fixes #6274 — committed to jogold/aws-cdk by jogold 4 years ago
- fix(lambda-nodejs): not meaningful parcel error message when build fails (#6277) * fix(lambda-nodejs): no parcel error message when build fails Parcel outputs its error message to `stdout` not `stde... — committed to aws/aws-cdk by jogold 4 years ago
@jogold I went ahead and ran
npm i -g parcel-bundlerto work around that error.Now I get:
Not sure what to do to figure out what the Error actually is.
Yes I know, the point was to see if this is a parcel error and what kind of error. In this case the out-dir doesn’t matter.
The
lambdaNodejs.NodejsFunctionbuilds in a subfolder ofsrc/restart-service/.build. Again just a test here to see if it’s parcel related. Looks like it’s not?I should note that I’ve also tried to use
@aws-cdk/aws-lambda-nodejsbut I getError: spawnSync parcel ENOENTwhen I try that, so I was wondering if there was a way to do this without usingaws-lambda-nodejsor if I should keep trying to work through the ENOENT error.