Google cloud functions

Hi guys how to solve this error plz

ERROR: (gcloud.functions.deploy) Uncompressed deployment is 1486838328B, bigger than maximum allowed size of 536870912B.

1 Like

Hi,

Have you tried any of the following?

  1. Remove unnecessary files (exclude documentation, tests, unused modules).
  2. Optimize dependencies (review and remove unnecessary ones in your package.json or requirements.txt).
  3. Use .gcloudignore (exclude files and directories from deployment).
  4. Deploy from Cloud Storage (serve static files from a storage solution).
  5. Split your function (divide your function into smaller functions).

If none of the above helped, you can try re-architecting your application or using Google Cloud Run, it should allow larger deployments.