unable to import module "lambda"
See original GitHub issueI’m trying to migrate an existing express app.
I’ve deployed, but I’m getting this error in Cloudwatch:
Unable to import module 'lambda': Error
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
And “internal server error” when trying to hit my ApiUrl.
I’m require
ing my server in lambda.js and changed "main":
in my package.json to lambda.js
as well as following the other instructions. Could I be missing something obvious?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:19 (1 by maintainers)
Top Results From Across the Web
AWS error from Python: No module named lambda_function
Error was due to file name of the lambda function. While creating the lambda function it will ask for Lambda function handler.
Read more >How do I resolve the "Unable to import module ... - YouTube
... Knowledge Center article with this video: https://aws.amazon.com/premiumsupport/knowledge-center/ lambda - import - module -error-python/0...
Read more >Unable to import module lambda function No ... - Edureka
Hi@akhtar,. This error appears when you haven't named your code file or function correctly. You need to go to Lambda -> Functions ->...
Read more >Unable to import module 'lambda_function' - AWS re:Post
Your python file is called "lambda_handler.py" and the function is called "lambda_handler", but the error mentions "lambda_function". check that the "handler" ...
Read more >Amazon Lambda function errors in Python - 亚马逊云科技
This page describes how to view Lambda function invocation errors for the Python ... { "errorMessage": "Unable to import module 'lambda_function': Cannot ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a generic error that is not specific to this project.
It seems that this is a generic error which hides the real issue. The most consistent way I’ve found to debug is via the API Gateway test console which actually reveals the root error messages.