# Serverless invoke local function with mock has no output

**URL:** <https://forum.serverless.com/t/serverless-invoke-local-function-with-mock-has-no-output/10845>\
**Category:** Serverless Framework\
**Tags:** aws, lambda\
**Created:** [March 20, 2020, 11:30pm UTC](https://forum.serverless.com/t/serverless-invoke-local-function-with-mock-has-no-output/10845 "2020-03-20T23:30:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stcalica](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/stcalica/32/4070_2.png) [@stcalica](https://forum.serverless.com/u/stcalica)\
**Post date:** [March 20, 2020, 11:30pm UTC](https://forum.serverless.com/t/serverless-invoke-local-function-with-mock-has-no-output/10845/1 "2020-03-20T23:30:16Z")

</div>

I am following this tutorial here:

> **[Add a Get Note API](https://sst.dev/chapters/add-a-get-note-api.html)**
>
> To allow users to retrieve a note in our note taking app, we are going to add a GET note API. To do this we will add a new Lambda function to our Serverless Framework project. The Lambda function will retrieve the note from our DynamoDB table.

I’ve hit a wall where after I refactor my code I am not able to see the output anymore.  
Not even console.logs.

Here is my serverless function for get:

```
import * as dynamoDbLib from "./libs/dynamodb-lib";
import { success, failure } from "./libs/response-lib";

export async function main(event, context){
  const params = {
    TableName: process.env.tableName,
    // 'Key' defines the partition key and sort key of the item to be retrieved
    // - 'userId': Identity Pool identity id of the authenticated user
    // - 'noteId': path parameter
    Key: {
      userId: event.requestContext.identity.cognitoIdentityId,
      noteId: event.pathParameters.id
    }
  };
  try {
    const result = await dynamoDbLib.call("get", params);
    if (result.Item) {
      // Return the retrieved item
      return success(result.Item);
    } else {
      return failure({ status: false, error: "Item not found." });
    }
  } catch (e) {
    return failure({ status: false });
  }
}

```

And my code for the failure and success response in response-lib.js:

```
export function success(body) {
  return buildResponse(200, body);
}

    export function failure(body) {
      return buildResponse(500, body);
    }

    function buildResponse(statusCode, body) {
      return {
        statusCode: statusCode,
        headers: {
          "Access-Control-Allow-Origin": "*",
          "Access-Control-Allow-Credentials": true
        },
        body: JSON.stringify(body)
      };
    }

```

I am on OSX Mojave  
And have this serverless version:

> Framework Core: 1.67.0
> 
> Plugin: 3.5.0
> 
> SDK: 2.3.0
> 
> Components: 2.22.3
