Skip to content
Latchkey

Fastly Compute "package size exceeds" limit in CI

Fastly Compute packages (the compiled Wasm plus metadata) have an upload size limit. When the built package is over that limit, fastly compute deploy is rejected during upload.

What this error means

The deploy fails with an error stating the package size exceeds the maximum allowed. The compiled .wasm has grown past the per-package limit.

Fastly
Error: error during deploy

  Caused by:
    package size exceeds the maximum allowed size for a Compute package

Common causes

A large dependency compiled into the Wasm

A heavy crate or bundled asset inflates the compiled module past the upload limit.

Debug builds and embedded assets

A non-release build keeps debug symbols, and large static files embedded into the binary push the package over the cap.

How to fix it

Build for release and strip the binary

  1. Build in release mode so optimizations and stripping apply.
  2. Remove embedded assets you can serve from object storage instead.
  3. Re-run the package step and check the size before deploy.
Terminal
cargo build --release --target wasm32-wasi
fastly compute pack

Trim dependencies

Audit the dependency tree and remove or replace large crates that the Compute service does not strictly need.

How to prevent it

  • Build Compute packages in release mode.
  • Serve large assets from storage rather than embedding them.
  • Track the compiled package size in CI to catch growth early.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →