Invoke Lambda Functions Locally

Link to chapter - https://serverless-stack.com/chapters/invoke-lambda-functions-locally.html

Hi,

Following instructions I’m getting the following message:

Serverless plugin “serverless-bundle” not found. Make sure it’s installed and listed in the “plugins” section of your serverless config file

After installing with “npm i -g serverless-bundle” message is still showing

How come you are installing the package globally?

Use this starter https://github.com/AnomalyInnovations/serverless-nodejs-starter and you’ll be fine.

Isn’t it true that Serverless automatically sets IS_LOCAL env variable when you run sls invoke local?

1 Like

You are right, it does. We should update the chapter.

When I do serverless invoke local -f get --path events/get-event.json

I get:

Could not resolve “tableName” environment variable: Could not resolve Fn::ImportValue with name dev-notes-ext-infra-ExtTableName. Are you sure this value is exported ?

Any idea on what to do?

It is a part of the infrastructure service that was previously deployed. Just make sure you have that already setup.