-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
blocked/more-info-neededMore info is needed from the requester. If no response in 14 days, it will become stale.More info is needed from the requester. If no response in 14 days, it will become stale.type/featureFeature requestFeature request
Description
Hello,
I am unable to run a local lambda that relies on third party libraries, for example the redis one. The error I get is:
Unable to import module 'index'
For troubleshooting I:
- Started sam local with debug enabled (
sam local start-api--template notification.sam.yml --debug-port 5858) - Sent a curl request
- Attached VSCode debugger which was probably not needed.
- Found the docker container that spawned (
docker psand there was only one) - Attached an interactive shell to that container (
docker exec -it <machine_alias> bash) - And tried to find the node_modules for my lambda, it wasn't in the execution folder (where my index.js was) and couldn't find it anywhere else.
I also tried with the static-dir flag (sam local start-api--template notification.sam.yml --debug-port 5858 --static-dir node_modules) but didn't see any difference.
I think sam local takes all *.js files in the lambda root but ignores the package.json file and the node_modules folder. Can someone please let me know if Im doing something wrong or if this perhaps is expected behavior?
majoal0, bglowney and holtc
Metadata
Metadata
Assignees
Labels
blocked/more-info-neededMore info is needed from the requester. If no response in 14 days, it will become stale.More info is needed from the requester. If no response in 14 days, it will become stale.type/featureFeature requestFeature request