question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unable to import module "lambda"

See original GitHub issue

I’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 requireing 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:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
brettstackcommented, Apr 10, 2018

This is a generic error that is not specific to this project.

11reactions
mcwebbcommented, Nov 1, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found