`wrangler pages deployment delete` exits 0 without deleting when it cannot prompt
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cli, typescript
- Domain
- cli
Research direction
The delete prompt is the confirm(..., { fallbackValue: false }) call in packages/wrangler/src/pages/deployments.ts around lines 177-186. Compare it with the non-interactive --force check that wrangler queues purge already performs, and read that command's test to see how it is exercised. Done means that running delete with no TTY and no --force exits non-zero with a message naming --force, and that a declined interactive prompt prints a "Not deleting." line.
Written by the indexing model from the issue text.
Description
What versions & operating system are you using?
Wrangler 4.166.0, Node v24.19.0, Windows 11 (10.0.26300). The same code path is on main as of 2026-11-24 (wrangler 4.168.0).
Please provide a link to a minimal reproduction
Describe the Bug
wrangler pages deployment delete asks for confirmation with confirm(..., { fallbackValue: false }). When Wrangler cannot prompt (no TTY, or CI), confirm() answers with the fallback "no", the handler returns, nothing is deleted, and the process exits with code 0.
Steps to reproduce (any shell without a TTY, for example a CI job or a script):
wrangler pages deployment delete <deployment-id> --project-name <project> < /dev/null
echo $? # 0
The output shows the question and the fallback answer, but nothing says that the deployment was not deleted, and the exit code is 0:
? Are you sure you want to delete deployment "<deployment-id>" in project "<project>"? This action cannot be undone.
🤖 Using fallback value in non-interactive context: no
A cleanup job that runs this sees success while the deployment is still there.
Expected: exit non-zero with a message that says to pass --force, the way wrangler queues purge already does in non-interactive mode ("The --force flag is required to purge a Queue in non-interactive mode").
Related: --force is the only way past the prompt, and it is also sent to the API as force=true (since #13444), which deletes deployments that still have an active alias. So a script that only wants to skip the prompt has to opt into deleting aliased deployments as well.
This is not about the default answer discussed in #17098: this command already defaults to "no". It is only about that outcome being invisible to the caller.
I have a small fix with tests ready (an error and non-zero exit when --force is missing in a non-interactive context, and a "Not deleting." line when the prompt is declined interactively) and am happy to open a PR if that is welcome.
Found while tidying old deployments on my own Pages sites. The report and the fix were prepared with help from Claude (Anthropic).
Please provide any relevant error logs
None: that is the problem. See the output above.
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 1.7k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 282
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/workers-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
cloudflare/workers-sdk#17215 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
cloudflare/workers-sdk#17189 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/workers-sdk#17187 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
cloudflare/workers-sdk#17175 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloudflare/workers-sdk#17174 ·
Maintainers usually reply within 1 day
All issues in cloudflare/workers-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
earendil-works/pi#12615 ·
Maintainers usually reply within 1 day
-
My Caps shows "Shared" on private Caps that were never sharedPossibly taken @AksharP5 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CapSoftware/Cap#4569 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OHDSI/Data2Evidence#3749 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Flagsmith/flagsmith-nodejs-client#332 ·
Maintainers usually reply within 2 days