amplify:<function-name>
scripts that install devdependencies for build are installing production dependencies due to NODE_ENV=production
#11785
Labels
bug
Something isn't working
duplicate
If marked with duplicate, issue will be closed & original will be added for traceability
functions
Issues tied to the functions category
pending-release
Code has been merged but pending release
How did you install the Amplify CLI?
yarn
If applicable, what version of Node.js are you using?
14.19.1
Amplify CLI Version
10.6.1
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
Without any changes to our configuration, within the last week, the Amplify console build has recently stopped including the executable code for TypeScript Lambdas into the deployed Lambdas. We have been running under the same Lambda configuration for over a year.
I noticed b/c our CloudWatch logs for the Lambdas were showing an error:
The result of the Amplify console build that is stored in the deployment bucket in S3 is just the package.json, the compiled index.js is not included in the S3 deployment.
Running the build script locally with
yarn amplify:{LambdaName}
does output an index.js to the src/ folder within the Lambda.Note that if we run
amplify push
manually from the command line, then the Lambdas do get created properly and the resulting executable index.js files are included into the deployment.Here's the folder structure for each Lambda (within /amplify/backend/function/...):
The tsconfig.json files:
The build script in our root package.json:
I suspect that we may need to add
"outDir": "./src"
to our tsconfig.json, since that is where the index.js files end up, but I'm not sure, since it is working with a localamplify push
.Expected behavior
We expect that the compiled index.js files will be included in the deployment buckets (and thus deployed as part of the deployed Lambda files).
Reproduction steps
Project Identifier
ac2fa547ce795a99c33b7773e2d59f15
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: