Skip to main content

Error: "Unzipped size must be smaller than 262144000 bytes"

Symptoms

  • When uploading a bundle, error: Unzipped size must be smaller than 262144000 bytes

  • Running npm install --production yields an unzipped bundle size >160MB.

Cause

The uploaded bundle is too large. The maximum bundle size is 250MB, however this figure includes both the uploaded bundle and the engine. Consequently the absolute maximum unzipped developer bundle size is approximately 160MB to allow room for both the uploaded bundle and the engine and remain under the maximum total size of 250MB.

Solution

Option 1: Pre-bundle dependencies before Engine build process

Following this is a technique to identify expensive dependencies and pre-bundle them before Engine build process kicks in. With this method, you can remove expensive dependencies from your bundle so they stay really small (compared to original node_modules folder contents) in Engine's Lambda environment.

Optimizing (unzipped) lambda size with pre-building large dependencies

Option 2: Reduce unzipped size of the uploaded bundle. Some ways to do that are:

  1. Make sure that you only use the node modules that you absolutely require.

  2. Move some dependencies to devDependencies.

  3. Compress images.

  4. Move images to the `resources` folders.

See How to optimize your PageBuilder Engine bundle size for better page load and render performance for more information on reducing bundle size.

More Information