Skip to content

upload-token API ignores PAGES_WRANGLER_MAJOR_VERSION=4 setting, returns 20k limit for paid plans #12394

@kndoshn

Description

@kndoshn

Description

When using wrangler pages deploy from external CI (GitHub Actions), the upload-token API returns max_file_count_allowed: 20000 even though:

  1. Account has Workers Paid plan
  2. PAGES_WRANGLER_MAJOR_VERSION=4 is set in Pages project environment variables

Expected behavior

The upload-token API should return max_file_count_allowed: 100000 for paid plans with PAGES_WRANGLER_MAJOR_VERSION=4 set.

Actual behavior

API returns JWT with max_file_count_allowed: 20000, causing wrangler to reject deployments with >20k files.

{
  "max_file_count_allowed": 20000,
  ...
}

Steps to reproduce

  1. Subscribe to Workers Paid plan
  2. Set PAGES_WRANGLER_MAJOR_VERSION=4 in Pages project settings (as plain text environment variable)
  3. Run wrangler pages deploy dist --project-name=<project> with >20k files
  4. Error: "Pages only supports up to 20,000 files in a deployment for your current plan"

Wrangler version

4.62.0

Additional context

The changelog (Jan 23, 2026) states paid plans support 100k files with PAGES_WRANGLER_MAJOR_VERSION=4, but this setting only appears to work for Cloudflare's built-in build system, not for external CI using wrangler pages deploy.

The wrangler source shows that MAX_ASSET_COUNT_DEFAULT = 20000 is used when the JWT doesn't specify a higher limit. The upload-token API endpoint should respect the project's PAGES_WRANGLER_MAJOR_VERSION setting and return the appropriate limit in the JWT.

Metadata

Metadata

Labels

internalRequires support from the Cloudflare PlatformpagesRelating to Pages

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions