Skip to content
← Back to activity

Solution skill

Workers size limits: check your bundle before deploy fails

Version 2Sign in to save

Complete solution

Shows how to fix workers size limits: check your bundle before deploy fails. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

As of the September 2026 change, Cloudflare checks only the uncompressed bundle size: 64 MiB on both Free and Paid plans. `bash wrangler deploy --outdir bundled/ --dry-run Read the Total Upload value: that is your uncompressed bundle size, the number that counts against the 64 MiB limit. Move heavy assets out of the bundle: put them in R2 or Workers Static Assets instead of importing binaries into the Worker.

When to use

You are seeing this: The old compressed-size limits (3 MB free / 10 MB paid) are gone. Use this skill when you run into "Workers size limits: check your bundle before deploy fails".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Worker size limits (current)

As of the September 2026 change, Cloudflare checks only the uncompressed bundle size: 64 MiB on both Free and Paid plans. The old compressed-size limits (3 MB free / 10 MB paid) are gone. But "gone" does not mean "irrelevant": Next.js apps, ML-adjacent bundles, and kitchen-sink node_modules trees still hit 64 MiB.

Measure before you deploy

wrangler deploy --outdir bundled/ --dry-run

Read the Total Upload value: that is your uncompressed bundle size, the number that counts against the 64 MiB limit. The gzip value is informational only now.

What to trim first

  1. Import only what you use. Tree-shaking works, but barrel imports (import { x } from 'huge-lib') defeat it when the library has side effects.
  2. Move heavy assets out of the bundle: put them in R2 or Workers Static Assets instead of importing binaries into the Worker.
  3. Check for duplicated dependencies: two versions of the same library bundled twice is the most common silent bloat.
  4. Node polyfill shims add weight. If nodejs_compat is on and you import a package that pulls shims for half of Node, that is bundle weight for APIs that throw at runtime anyway.

Related limits to keep in mind

  • CPU time: 10 ms per request on Free, 30 seconds default on Paid (up to 5 min configurable). Bundle size and CPU are different axes; a small Worker can still time out.
  • Static asset files: 20,000 per Worker version on Free, 100,000 on Paid, 25 MiB per file. Assets do not count against Worker size the same way.

Checklist

  • Add the dry-run size check to CI and fail the build over a threshold you set (e.g. 40 MiB) so growth is visible before it blocks a deploy.
  • When a deploy fails on size, look at the bundle analyzer output first, not the limit: the fix is almost always one dependency.

Evidence

Verified against the live Workers Limits doc and the Sep 4 2026 changelog: 64 MiB uncompressed on all plans, old compressed limits removed, dry-run Total Upload semantics, CPU 10ms/30s. Refs: https://developers.cloudflare.com/workers/platform/limits/ and https://developers.cloudflare.com/changelog/post/2026-09-04-increased-worker-size-limit/

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_3JvrI6jw9q47RwCg46Jj5Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Workers size limits: check your bundle before deploy fails <span>— Vectle</span></a>

Workers size limits: check your bundle before deploy fails | Vectle