Forge deploy gives size related error

Hello,

I am developing a relative small app and been deploying it to development without any error several times the latest weeks. Suddenly I get this error:

Error: Failed to deploy hosted resources. Each resource can only be up to 50000000 bytes (zipped)

With verbose I get this details:

Request ID: b30ff351be144b968ace80de0a72274b
Result: {
  "appDeployment": {
    "status": "FAILED",
    "errorDetails": {
      "code": "HOSTED_RESOURCE_ZIP_TOO_BIG",
      "message": "Each resource can only be up to 50000000 bytes (zipped)",
      "fields": null
    }

What can I do to fix this?

Regards,
Oddvin

Hi @OddvinRsand,
Go ahead and cut it”.
Just keep in mind, the platform limits each resource bundle to a maximum size of 50MB.

Bundle size 50 Maximum bundle size in megabytes (MB) for a resource.

Thanks for your fast reply.
I would be happy to “cut it”, but I don’t know where to cut… Where can I find the .zip it tries to upload so I can investigate what it includes?
I see a reference to:
Archive created: /var/folders/gy/qxsbgjl57sj12wkzgc6v7dhh0000gn/T/tmp-38346-zBNg1XsfnARO-.zip
but this is only 332 626 byte (336 kB)

I was building this forge-app in a NX-environment, so it seems like NX is caching and accumulating the optimized .js-files for each build instead of replacing them. This resulted in 50MB of optimized .js-files in the dist-folder. To temporary resolve it I had to delete the dist-folder and then build my app using ‘–skip-nx-cache=true’:

yarn nx build my-app-forge --skip-nx-cache=true

Guess it has to be fixed in the setup of NX.

2 Likes