invoke local cannot find module #9543
Replies: 3 comments 4 replies
-
Hello, could you please follow the issue template that is visible when you create a new one? From the above report it's hard to evaluate if this is a bug in the Framework or some misconfiguration. Thanks in advance |
Beta Was this translation helpful? Give feedback.
-
@pgrzesik Created a sample repository It works on AWS Lambda consoles It does not work in a local environment
|
Beta Was this translation helpful? Give feedback.
-
Hello @goda-kazuki 👋 Thanks for additional details. I believe the problem here is with configuration, so I'm going to move this to "Discussions" section. As for the problem itself, it looks like in the example in Lambda console, you're not using any additional dependencies which are imported from Could you please try again after ensuring that |
Beta Was this translation helpful? Give feedback.
-
I'm using layer
layer->nodejs->node_module
It will try to call it from lambda.
const MySQL = require('moment');
(moment is included in node_module)
sls invoke local -f main
Error: Cannot find module 'moment'
It works in the aws lambda console
What should I do?
Beta Was this translation helpful? Give feedback.
All reactions