Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to develop code to run for Lambda's, current setup is painfully slow and manual #5553

Closed
PeteDuncanson opened this issue Oct 10, 2020 · 4 comments · Fixed by #6350
Closed
Assignees
Labels
bug Something isn't working mock Issues tied to the mock functionality pending-response Issue is pending response from the issue author

Comments

@PeteDuncanson
Copy link

Note: If your question is regarding the AWS Amplify Console service, please log it in the
official AWS Amplify Console forum

Which Category is your question related to?

I'm after knowing if there is a better way to develop my code for running in a Function/Lambda. Currently (after initially creating the Function via Amplify) I'm manually editing the code in the browser editor for the Lambda itself. I then trigger the Lambda by uploading a file to S3 (its an import so this is how it will be run anyway). That loop though is slow going and totally kills any flow.

I've tried mocking the Function locally but if there are any errors or typos in my code it just hangs and won't give any details so the only way I've found to get anything sensible out is to edit it on live/dev directly.

Deploying a Lambda Layer for the shared/core code did wonders for making development easier, I wonder if there is something else I'm missing that might make this more sane and speedy?

Amplify CLI Version

You can use amplify -v to check the amplify cli version on your system

4.29.4

What AWS Services are you utilizing?

Functions/Lambda

Provide additional details e.g. code snippets

@ammarkarachi
Copy link
Contributor

It could be a possible issue with our mock functions feature. Does Amplify mock function <functionNAme>not return errors?

@ammarkarachi ammarkarachi added mock Issues tied to the mock functionality pending-response Issue is pending response from the issue author question General question labels Oct 12, 2020
@PeteDuncanson
Copy link
Author

No. It will just hangs. Apparently the mocking for functions spins up the function in another thread/process and the errors get swallowed. This makings doing any development locally impossible unless you like doing binary chop debugging while trying to find a typo...the only way I found to actually get some output/feedback was to deploy it to the cloud as at least then it will tell you what is wrong. That copy/paste/deploy/upload loop is a killer for productivity (there are only so many times you can resist temptations while you wait..."I'll just go check twitter...")

@berenddeboer
Copy link

See also #5159. Long standing issue.

@yuth yuth added this to To do in Bug bash via automation Oct 19, 2020
@yuth yuth added bug Something isn't working and removed question General question labels Oct 19, 2020
@SwaySway SwaySway self-assigned this Jan 9, 2021
@SwaySway SwaySway moved this from To do to In progress in Bug bash Jan 9, 2021
SwaySway added a commit to SwaySway/amplify-cli that referenced this issue Jan 9, 2021
return proper error message and stack if a string error is provided return string error as is

fix aws-amplify#5553
@SwaySway SwaySway moved this from In progress to Review in Bug bash Jan 9, 2021
SwaySway added a commit to SwaySway/amplify-cli that referenced this issue Jan 12, 2021
return proper error message and stack if a string error is provided return string error as is

fix aws-amplify#5553
SwaySway added a commit to SwaySway/amplify-cli that referenced this issue Jan 12, 2021
return proper error message and stack if a string error is provided return string error as is

fix aws-amplify#5553
SwaySway added a commit to SwaySway/amplify-cli that referenced this issue Jan 12, 2021
return proper error message and stack if a string error is provided return string error as is

fix aws-amplify#5553
Bug bash automation moved this from Review to Done Jan 14, 2021
Function mock improvements automation moved this from To do to Done Jan 14, 2021
edwardfoyle pushed a commit that referenced this issue Jan 14, 2021
#6350)

return proper error message and stack if a string error is provided return string error as is

fix #5553
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working mock Issues tied to the mock functionality pending-response Issue is pending response from the issue author
Projects
Bug bash
  
Done
Development

Successfully merging a pull request may close this issue.

5 participants