Amplify-cli: amplify mock function <functionName>: Command failed with exit code 1

Created on 22 Sep 2020  路  3Comments  路  Source: aws-amplify/amplify-cli

Describe the bug
When I run amplify mock function <functionName>, I get the following output:

<functionName> failed with the following error:
Command failed with exit code 1: /usr/local/bin/node /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-nodejs-function-runtime-provider/lib/utils/execute.js

However, it seems like the function runs fine because I get the following output on the next line:

{"result":{"statusCode":200,"body":"\"Hello from Lambda!\""},"error":null}

It also says: Finished execution.

Amplify CLI Version
4.29.2

To Reproduce
amplify init
amplify add function
amplify mock function

Expected behavior
No errors

Desktop (please complete the following information):

  • OS: Mac
  • Node Version. 12.16.3

Additional context
Clean install, clean amplify project.

bug functions mock

Most helpful comment

I'm running into the same issue too.

All 3 comments

@alexboulay Thanks for issue, I was able to reproduce we are investigating and will have an update soon.

I'm running into the same issue too.

I'm still seeing this exact error on all 4.29.x CLI versions including 4.29.7

Had to downgrade to 4.28.2 where it works

  • OS: Mac
  • Node Version. 12.19.0
Was this page helpful?
0 / 5 - 0 ratings