Skip to content

wrangler types causes Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76 #13747

@Atulin

Description

@Atulin

What versions & operating system are you using?

❯ bunx envinfo --system --npmPackages '{wrangler,create-cloudflare,miniflare,@cloudflare/*}' --binaries

  System:
    OS: Windows 11 10.0.26200
    CPU: (24) x64 AMD Ryzen 9 9900X 12-Core Processor
    Memory: 28.21 GB / 61.61 GB
  Binaries:
    Node: 24.15.0 - C:\Users\[username]\AppData\Local\fnm_multishells\59556_1777501796804\node.EXE
    npm: 11.12.1 - C:\Users\[username]\AppData\Local\fnm_multishells\59556_1777501796804\npm.CMD
    bun: 1.3.13 - C:\Users\[username]\.bun\bin\bun.EXE
    Deno: 2.7.14 - C:\Users\[username]\AppData\Local\Microsoft\WinGet\Links\deno.EXE
  npmPackages:
    @cloudflare/vitest-pool-workers: ^0.12.4 => 0.12.21
    wrangler: ^4.86.0 => 4.86.0

Please provide a link to a minimal reproduction

It happens on wrangler init, not really any repro

Describe the Bug

❯ wrangler types

 ⛅️ wrangler 4.86.0
───────────────────
Generating project types...

declare namespace Cloudflare {
        interface GlobalProps {
                mainModule: typeof import("./src/index");
        }
        interface Env {
        }
}
interface Env extends Cloudflare.Env {}

Generating runtime types...


▲ [WARNING] A fetch request failed, likely due to a connectivity issue.


  Common causes:
    - No internet connection or network connectivity problems
    - Firewall or VPN blocking the request
    - Network proxy configuration issues

  Please check your network connection and try again.


✘ [ERROR] fetch failed


If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
🪵  Logs were written to "C:\Users\[username][\AppData\Roaming\xdg.config\.wrangler\logs\wrangler-2026-04-29_22-48-28_653.log"
Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76

Please provide any relevant error logs

Details
--- 2026-04-29T22:48:28.767Z debug
🪵  Writing logs to "C:\Users\[username]\AppData\Roaming\xdg.config\.wrangler\logs\wrangler-2026-04-29_22-48-28_653.log"
---

--- 2026-04-29T22:48:28.767Z debug
.env file not found at "F:\[project]\.env". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---

--- 2026-04-29T22:48:28.767Z debug
.env file not found at "F:\[project]\.env.local". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---

--- 2026-04-29T22:48:28.772Z log

 ⛅️ wrangler 4.86.0
───────────────────
---

--- 2026-04-29T22:48:28.774Z debug
Metrics dispatcher: Posting data {"deviceId":"a2d2a25d-e03a-4450-85f2-b3252c2fd5ca","event":"wrangler command started","timestamp":1777502908774,"properties":{"amplitude_session_id":1777502908773,"amplitude_event_id":0,"wranglerVersion":"4.86.0","wranglerMajorVersion":4,"wranglerMinorVersion":86,"wranglerPatchVersion":0,"osPlatform":"Windows","osVersion":"Windows 11 Home","nodeVersion":24,"isFirstUsage":false,"configFileType":"none","isCI":false,"isPagesCI":false,"isWorkersCI":false,"isInteractive":true,"hasAssets":false,"agent":null,"argsUsed":[],"argsCombination":"","sanitizedCommand":"types","sanitizedArgs":{}}}
---

--- 2026-04-29T22:48:28.872Z log
Generating project types...

---

--- 2026-04-29T22:48:28.873Z debug
local dev variables file not found at ".dev.vars". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---

--- 2026-04-29T22:48:28.873Z debug
.env file not found at "F:\[project]\.env". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---

--- 2026-04-29T22:48:28.873Z debug
.env file not found at "F:\[project]\.env.local". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---

--- 2026-04-29T22:48:28.876Z log
declare namespace Cloudflare {
	interface GlobalProps {
		mainModule: typeof import("./src/index");
	}
	interface Env {
	}
}
interface Env extends Cloudflare.Env {}

---

--- 2026-04-29T22:48:28.876Z log
Generating runtime types...

---

--- 2026-04-29T22:48:30.127Z debug
Metrics dispatcher: Posting data {"deviceId":"a2d2a25d-e03a-4450-85f2-b3252c2fd5ca","event":"wrangler command errored","timestamp":1777502910127,"properties":{"amplitude_session_id":1777502908773,"amplitude_event_id":1,"wranglerVersion":"4.86.0","wranglerMajorVersion":4,"wranglerMinorVersion":86,"wranglerPatchVersion":0,"osPlatform":"Windows","osVersion":"Windows 11 Home","nodeVersion":24,"isFirstUsage":false,"configFileType":"none","isCI":false,"isPagesCI":false,"isWorkersCI":false,"isInteractive":true,"hasAssets":false,"agent":null,"argsUsed":[],"argsCombination":"","sanitizedCommand":"types","sanitizedArgs":{},"durationMs":1358,"errorType":"TypeError"}}
---

--- 2026-04-29T22:48:30.128Z log

---

--- 2026-04-29T22:48:30.221Z warn
▲ [WARNING] A fetch request failed, likely due to a connectivity issue.

  
  Common causes:
    - No internet connection or network connectivity problems
    - Firewall or VPN blocking the request
    - Network proxy configuration issues
  
  Please check your network connection and try again.


---

--- 2026-04-29T22:48:30.222Z error
✘ [ERROR] fetch failed


---

--- 2026-04-29T22:48:30.222Z debug
TypeError: fetch failed
    at Object.processResponse (C:\Users\[username]\.bun\install\global\node_modules\undici\lib\web\fetch\index.js:237:16)
    at C:\Users\[username]\.bun\install\global\node_modules\undici\lib\web\fetch\index.js:1081:19
    at node:internal/process/task_queues:150:7
    at AsyncResource.runInAsyncScope (node:async_hooks:227:14)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:147:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at C:\Users\[username]\.bun\install\global\node_modules\undici\index.js:157:7
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async fetch5 (C:\Users\[username]\.bun\install\global\node_modules\miniflare\dist\src\index.js:58932:20)
    at async _Miniflare.dispatchFetch (C:\Users\[username]\.bun\install\global\node_modules\miniflare\dist\src\index.js:89089:22)
    at async generate (C:\Users\[username]\.bun\install\global\node_modules\wrangler\wrangler-dist\cli.js:296222:17)
    at async generateRuntimeTypes (C:\Users\[username]\.bun\install\global\node_modules\wrangler\wrangler-dist\cli.js:296199:19)
    at async Object.handler (C:\Users\[username]\.bun\install\global\node_modules\wrangler\wrangler-dist\cli.js:299072:51)
    at async C:\Users\[username]\.bun\install\global\node_modules\wrangler\wrangler-dist\cli.js:183853:26
    at async Object.handler (C:\Users\[username]\.bun\install\global\node_modules\wrangler\wrangler-dist\cli.js:183802:7)
---

--- 2026-04-29T22:48:30.222Z log
If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
---

Metadata

Metadata

Labels

needs reproductionNeeds reproduction from OPtypesTypes issues to do with wrangler type generation

Type

No fields configured for Bug.

Projects

Status

Untriaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions