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.
✘ [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
- List projects with
wrangler pages project listto confirm the exact name. - Create it once if missing with
wrangler pages project create. - Deploy with the matching
--project-name.
npx wrangler pages project create my-site --production-branch main
npx wrangler pages deploy dist --project-name my-siteConfirm the account id matches
Set CLOUDFLARE_ACCOUNT_ID to the account that owns the project so the name resolves.
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}How to prevent it
- Keep the
--project-nameidentical to the dashboard project. - Create the Pages project once before automating deploys.
- Point
CLOUDFLARE_ACCOUNT_IDat the owning account.