Skip to content

Instantly share code, notes, and snippets.

@josefaidt
Last active August 11, 2022 18:32
Show Gist options
  • Save josefaidt/a117076b7bea81e1872e275176dbb23c to your computer and use it in GitHub Desktop.
Save josefaidt/a117076b7bea81e1872e275176dbb23c to your computer and use it in GitHub Desktop.
Amplify CLI symlink issue with functions
@Etep15
Copy link

Etep15 commented Aug 11, 2022

For anyone that runs into this issue but the above does not solve the problem. Using this in combination with this solution [amplify-graphql-syntax-workaround as per Josef's recommendation solved the problem for me. To make it clear, here are the steps I followed :

  1. Login to AWS Web Console and go to S3
  2. Select your deployment bucket (ie. amplify-[YOUR_PROJECT]-[YOUR_ENV]-[SOME #}-deployment)
  3. download the #current-cloud-backend.zip file.
  4. Set the directory to your root project folder (contains the amplify folder)
  5. unzip this file by doing the following (dependant on where the zip file you downloaded is, I temporarily copied it to my project folder) unzip #current-cloud-backend.zip -d amplify/#current-cloud-backend
  6. Remove the node_modules in your lambda layer in the #current-cloud-backend folder with rm -rf amplify/#current-cloud-backend/function/[YOUR_LAMBDA_LAYER_NAME]/lib/nodejs/node_modules
  7. Remove the temp folder with rm -rf amplify/.temp
  8. cd amplify/#current-cloud-backend/
  9. zip -r "../#current-cloud-backend.zip" *
  10. cd ..
  11. Upload the new #current-cloud-backend.zip file to the S3 bucket (click the orange Upload button). This will overwrite the existing .zip file that is already there (the one your downloaded before).
  12. cd .. You should now be back in the root folder of your project (where the amplify folder exists).
  13. amplify push --force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment