Skip to content
Latchkey

Wrangler Pages "Project not found" (--project-name) in CI

A wrangler pages deploy needs a project that already exists in the account. If the --project-name does not match an existing Pages project (or you are pointed at the wrong account), Cloudflare returns "Project not found". Create the project first or fix the name.

What this error means

Deploy fails with "Project not found. The specified project name does not match any of your existing projects." on a wrangler pages deploy step.

wrangler
✘ [ERROR] Project not found. The specified project name does not match any of your existing projects.

Common causes

The project name is wrong or the project does not exist

Pages does not auto-create projects on deploy in CI; the --project-name must match an existing project exactly.

Deploying to the wrong account

The project exists, but CLOUDFLARE_ACCOUNT_ID points at a different account where that project name is unknown.

How to fix it

Create the project, then deploy to it

  1. List projects with wrangler pages project list to confirm the exact name.
  2. Create it once if missing with wrangler pages project create.
  3. Deploy with the matching --project-name.
Terminal
npx wrangler pages project create my-site --production-branch main
npx wrangler pages deploy dist --project-name my-site

Confirm the account id matches

Set CLOUDFLARE_ACCOUNT_ID to the account that owns the project so the name resolves.

.github/workflows/ci.yml
env:
  CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

How to prevent it

  • Keep the --project-name identical to the dashboard project.
  • Create the Pages project once before automating deploys.
  • Point CLOUDFLARE_ACCOUNT_ID at the owning account.

Related guides

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