cloudflare / cloudflare/workers-sdk

Uncaught error in wrangler pages deploy when static asset upload fails

Open
#10,504 0 comments 1 reaction 3 assignees Claimed by @korinne View on GitHub
api package:wrangler product:pages
Dominant language
TypeScript
Stars
4.5k
Forks
1.5k
Avg merge
3d 8h
Merged PRs (30d)
187

Description

### What versions & operating system are you using?

`
osPlatform":"Windows","osVersion":"Windows 11 Home","nodeVersion":22,"packageManager":"npm","isFirstUsage":false,"configFileType":"none","isCI":false,"isPagesCI":false,"isWorkersCI":false,"isInteractive":true,"hasAssets":false,"argsUsed":["projectName"],"argsCombination":"projectName","command":"wrangler pages deploy"
`

### Please provide a link to a minimal reproduction

_No response_

### Describe the Bug

So I have a project which I need to upload a lot of photos and 3D models as a gallery to Cloudflare Pages (each one is smaller than 20MB, but there are about 7000 files in total + about 20 html / css / js file)

And after I analyzed the log, it will request some APIs before handling local files, and then upload the file and token after this process, which caused this problem.

Also could you please add a process bar about the analyze process, it is very painful to just look at my task manager CPU usage without actually knowing the progress.

Thank you Cloudflare the most kind company!

Here is the log:

```
--- 2025-08-30T00:00:27.181Z debug
🪵 Writing logs to "[USER_PATH]\.wrangler\logs\wrangler-2025-08-30_00-00-27_105.log"
---

--- 2025-08-30T00:00:27.181Z debug
Metrics dispatcher: Posting data {"deviceId":"[DEVICE_ID]","event":"wrangler command started","timestamp":1756512027180,"properties":{"amplitude_session_id":***,"amplitude_event_id":0,"wranglerVersion":"4.33.1","osPlatform":"Windows","osVersion":"Windows 11 Home","nodeVersion":22,"packageManager":"npm","isFirstUsage":false,"configFileType":"none","isCI":false,"isPagesCI":false,"isWorkersCI":false,"isInteractive":true,"hasAssets":false,"argsUsed":["projectName"],"argsCombination":"projectName","command":"wrangler pages deploy","args":{"projectName":"[PROJECT_NAME]","uploadSourceMaps":false,"directory":"[DIRECTORY_PATH]"}}}
---

--- 2025-08-30T00:00:27.186Z debug
.env file not found at "[USER_PATH]\.env". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---

--- 2025-08-30T00:00:27.186Z debug
.env file not found at "[USER_PATH]\.env.local". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---

--- 2025-08-30T00:00:27.212Z log

⛅️ wrangler 4.33.1
───────────────────
---

--- 2025-08-30T00:00:27.215Z debug
Retrieving cached values for account_id and project_name from node_modules\.cache\wrangler
---

--- 2025-08-30T00:00:27.215Z debug
-- START CF API REQUEST: GET https://api.cloudflare.com/client/v4/accounts/[ACCOUNT_ID]/pages/projects/[PROJECT_NAME]
---

--- 2025-08-30T00:00:27.215Z debug
QUERY STRING: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:00:27.215Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:00:27.215Z debug
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:00:27.215Z debug
-- END CF API REQUEST
---

--- 2025-08-30T00:00:27.499Z debug
-- START CF API RESPONSE: OK 200
---

--- 2025-08-30T00:00:27.499Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:00:27.499Z debug
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:00:27.499Z debug
-- END CF API RESPONSE
---

--- 2025-08-30T00:00:27.527Z debug
-- START CF API REQUEST: GET https://api.cloudflare.com/client/v4/accounts/[ACCOUNT_ID]/pages/projects/[PROJECT_NAME]
---

--- 2025-08-30T00:00:27.527Z debug
QUERY STRING: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:00:27.527Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:00:27.527Z debug
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:00:27.527Z debug
-- END CF API REQUEST
---

--- 2025-08-30T00:00:27.715Z debug
-- START CF API RESPONSE: OK 200
---

--- 2025-08-30T00:00:27.715Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:00:27.715Z debug
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:00:27.715Z debug
-- END CF API RESPONSE
---

--- 2025-08-30T00:10:35.778Z debug
-- START CF API REQUEST: GET https://api.cloudflare.com/client/v4/accounts/[ACCOUNT_ID]/pages/projects/[PROJECT_NAME]/upload-token
---

--- 2025-08-30T00:10:35.778Z debug
QUERY STRING: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:10:35.778Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:10:35.778Z debug
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---

--- 2025-08-30T00:10:35.778Z debug
-- END CF API REQUEST
---

--- 2025-08-30T00:10:35.809Z log

---

--- 2025-08-30T00:10:35.917Z error
X [ERROR] fetch failed

---

--- 2025-08-30T00:10:35.917Z debug
TypeError: fetch failed
at fetch ([USER_PATH]\node_modules\wrangler\wrangler-dist\cli.js:23176:17)
at async performApiFetch ([USER_PATH]\node_modules\wrangler\wrangler-dist\cli.js:49804:10)
at async fetchInternal ([USER_PATH]\node_modules\wrangler\wrangler-dist\cli.js:49824:20)
at async fetchResult ([USER_PATH]\node_modules\wrangler\wrangler-dist\cli.js:50001:16)
at async fetchJwt ([USER_PATH]\node_modules\wrangler\wrangler-dist\cli.js:93413:19)
at async upload ([USER_PATH]\node_modules\wrangler\wrangler-dist\cli.js:93421:17)
at async deploy ([USER_PATH]\node_modules\wrangler\wrangler-dist\cli.js:93762:20)
at async Object.handler ([USER_PATH]\node_modules\wrangler\wrangler-dist\cli.js:94659:50)
at async Object.handler ([USER_PATH]\node_modules\wrangler\wrangler-dist\cli.js:85117:7)
---

--- 2025-08-30T00:10:35.917Z log
If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
---

--- 2025-08-30T00:13:38.665Z debug
Sentry: Capturing exception TypeError: fetch failed
---

--- 2025-08-30T00:13:38.698Z debug
Metrics dispatcher: Posting data {"deviceId":"[DEVICE_ID]","event":"wrangler command errored","timestamp":1756512818698,"properties":{"amplitude_session_id":***,"amplitude_event_id":1,"wranglerVersion":"4.33.1","osPlatform":"Windows","osVersion":"Windows 11 Home","nodeVersion":22,"packageManager":"npm","isFirstUsage":false,"configFileType":"none","isCI":false,"isPagesCI":false,"isWorkersCI":false,"isInteractive":true,"hasAssets":false,"argsUsed":["projectName"],"argsCombination":"projectName","command":"wrangler pages deploy","args":{"projectName":"[PROJECT_NAME]","uploadSourceMaps":false,"directory":"[DIRECTORY_PATH]"},"durationMs":791525,"durationSeconds":791.525,"durationMinutes":13.192083333333333,"errorType":"TypeError"}}
---
```

### Please provide any relevant error logs

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.