cloudflare / cloudflare/workers-sdk

[BUG?]: Throws error "Server is not running" as server.close already ran

Closed
#15,366 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.5k
Forks
1.5k
Avg merge
3d 8h
Merged PRs (30d)
187

Description

I'm using [`@astrojs/cloudflare": "14.2.5"`](https://npmx.dev/package/@astrojs/cloudflare) which when building fails with an error "Server is not running.", which I've narrowed down to here:

https://github.com/cloudflare/workers-sdk/blob/5377aaed47144ef5dc873d77a4e3aba0d0232f7c/packages/miniflare/src/plugins/core/inspector-proxy/inspector-proxy-controller.ts#L334-L337

From my interpretation, `server.closeAllConnections()` is ... closed the servers connections (duh... hence the name), but then the following `server.close()` is throwing an error as there is no server left to close 🤷...

Seems a bit string to "throw" when the valid outcome occurred.

(With: Bun v1.4.0 & Wrangler v4.126.0)

Contributor guide

Open the contributing guide

Research direction

Start in packages/miniflare/src/plugins/core/inspector-proxy/inspector-proxy-controller.ts at lines 334-337 and reproduce the failure by building the Astro Cloudflare integration with the reported Bun and Wrangler versions. Trace the server shutdown path and verify that a server whose connections were already closed does not make the build fail with “Server is not running.”

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.