Every "my deploy succeeded but the site didn't change" thread has the same root: people expect wrangler pages deploy to update a site. It updates a deployment.

npx wrangler pages deploy dist --branch main ✨ Uploaded 44 files ✨ https://<hash>.project.pages.dev 

That hash hostname is the thing you just created. Your production hostname follows it only if the deploy went to the production branch. And the directory you named is the deployment — there is no merge with what was there before.

Symmetric consequences

  • A file you added is served.
  • A file you removed is gone from the live site, because it is not in the upload.
  • A file you renamed becomes a new path plus a dead old path — which is how a site grows 404s nobody wrote.

Direct Upload has no notion of "keep the previous version's other files". That is not a bug to work around; it is the model.

Four causes, in the order they actually happen

1. The wrong directory. wrangler pages deploy . from the project root instead of dist/. Success message, valid deployment URL, unchanged site — you uploaded source files no browser can render. Two instant checks: ls dist/index.html, and the file count in the upload line versus what your build reports.

2. The wrong branch. A deploy to a preview branch produces a real, reachable deployment that production never points at. --branch main (or your project's production branch) is not decoration.

3. An edge cache still serving the old asset. A deploy does not evict what a cache already holds. Add a query string: if /path 200s with the old body and /path?x=1 404s, the build is right and the cache is stale.

4. You are looking at an old hash hostname. Previous deployments stay reachable at their own URLs. Checking <hash>.project.pages.dev from a bookmark, or from a link someone pasted last week, tells you nothing about production.

About --commit-dirty=true

It lets the deploy proceed when the working tree has uncommitted changes. It suppresses a prompt. It does not change what gets uploaded, and it is not a "force" flag for content.

The one-way door

You cannot switch a Direct Upload project to Git integration later. Cloudflare's docs are explicit: that is a new project. Worth knowing before you pick a workflow, because it is the kind of detail that only surfaces when someone asks for preview builds per PR.

Verification that survives a rewrite

Don't assert the deploy log; assert the artifact. After upload, curl the production host for one changed path and one removed path:

curl -sI https://<site>/<changed-path> | head -1 curl -sI https://<site>/<removed-path> | head -1 

Expect 200 and 404/301. If the changed path 200s with old bytes, you are in cause 3. If the removed path still 200s, check whether it is cache or upload before touching config — the query-string test separates them in one request.

(Full write-up with the four failure signatures on our site: https://sitepostmortem.com/build-tools/wrangler-pages-deploy-stale/)