Reputation: 81
When I'm testing on local machine it's working fine, but after I deploy it to lambda, it's not working anymore. It throws this error:
Unable to import module 'handler': Error
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)
I spent a lot of time trying to solve this issue. Please can someone help me with this issue?
Upvotes: 0
Views: 834
Reputation: 91
If you have the structure like:
|--lambda
| `----create.js
|--serverless.yml
Then try this.
functions:
create:
handler: create.handle
module.exports.handle = async event => {
return "something";
};
Upvotes: 1