#270 introduced a bug resulting in failure to deploy and run when using Chalice. The cause is that the Chalice packager does not include the full contents of the chalice wheel/package in the generated deployment zip. Code that was added to support local development imports from chalice.config import Config which fails in a production deployment with the error [ERROR] Runtime.ImportModuleError: Unable to import module 'app': No module named 'chalice.config'. The solution is to refactor the LocalLambdaClient into a separate file and wrap the import in try/catch when in production.
Reproducible in:
slack_bolt==1.5.0
Python 3.8.6
AWS Lambda Python 3.8
Steps to reproduce:
chalice package or chalice deploy
Expected result:
Deployments through chalice should produce working lambda function.
Actual result:
Deployed lambda function fails with error:
[ERROR] Runtime.ImportModuleError: Unable to import module 'app': No module named 'chalice.config'