Open tredfield opened 2 days ago
Check template.yml: Make sure the configuration in the template.yml file is consistent with the default template, especially the CodeUri and Handler settings of the Lambda function.
It may also be a compatibility issue between Docker and Mac. You can use servbay to redeploy and check, which only takes 2 minutes.
Description:
Running
sam deploy --template template.yml
fails to package app appropriatelySteps to reproduce:
Observed result:
Function fails with
"ERROR","message":{"errorType":"ImportModuleError","errorMessage":"Error: Cannot find module 'app'
Expected result:
Packaging of function should be same with or without --template parameter
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.126.0{ "version": "1.126.0", "system": { "python": "3.8.20", "os": "macOS-14.6.1-x86_64-i386-64bit" }, "additional_dependencies": { "docker_engine": "Not available", "aws_cdk": "2.138.0 (build 6b41c8b)", "terraform": "1.5.7" }, "available_beta_feature_env_vars": [ "SAM_CLI_BETA_FEATURES", "SAM_CLI_BETA_BUILD_PERFORMANCE", "SAM_CLI_BETA_TERRAFORM_SUPPORT", "SAM_CLI_BETA_RUST_CARGO_LAMBDA" ] }
Add --debug flag to command you are running