mikestaub / serverless-express

Run your unmodified express app on AWS Lambda via the Serverless framework.
MIT License
150 stars 21 forks source link

Unable to import module 'handler': Error #11

Closed VenkateshSM closed 5 years ago

VenkateshSM commented 5 years ago

I get this error: Error: Unable to import module 'handler'.

Check AWS Lambda logs below:

> Unable to import module 'handler': Error
> at Function.Module._resolveFilename (module.js:547:15)
> at Function.Module._load (module.js:474:25)
> at Module.require (module.js:596:17)
> at require (internal/module.js:11:18)
> at Object.<anonymous> (/var/task/models/user.js:2:16)
> at Module._compile (module.js:652:30)
> at Object.Module._extensions..js (module.js:663:10)
> at Module.load (module.js:565:32)
> at tryModuleLoad (module.js:505:12)
> at Function.Module._load (module.js:497:3)
> at Module.require (module.js:596:17)
> at require (internal/module.js:11:18)
> at Object.<anonymous> (/var/task/controllers/user.js:1:76)
> at Module._compile (module.js:652:30)
> at Object.Module._extensions..js (module.js:663:10)
> at Module.load (module.js:565:32)
iliasbhal commented 5 years ago

Hi, @VenkateshSM, can you share how you import the module ?

VenkateshSM commented 5 years ago

I found out the issues. The issue was not with this library.

It was due to bcrypt module issue, It was not able to find the handler.

Log was not clear in AWS.

Anyway thanks for the help!