cloudflare / workers-sdk

โ›…๏ธ Home to Wrangler, the CLI for Cloudflare Workersยฎ
https://developers.cloudflare.com/workers/
Apache License 2.0
2.7k stars 709 forks source link

๐Ÿ› BUG: Error when turning off local mode with "l" key if http_proxy is set #5688

Closed reekystive closed 3 months ago

reekystive commented 6 months ago

Which Cloudflare product(s) does this pertain to?

Wrangler core

What version(s) of the tool(s) are you using?

Wrangler 3.51.2

What version of Node are you using?

v18.19.0

What operating system and version are you using?

macOS Sonoma 14.4.1

Describe the Bug

Steps to reproduce

  1. Create a fresh wrangler project with wrangler init
  2. Run pnpm install
  3. Set http_proxy and https_proxy environment variables
  4. Run wrangler dev
  5. Error when turning off local mode with l key

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

$ pnpm dev

> dawn-disk-c7f8@0.0.0 dev .../dawn-disk-c7f8
> wrangler dev

Proxy environment variables detected. We'll use your proxy for fetch requests.
 โ›…๏ธ wrangler 3.51.2
-------------------
โŽ” Starting local server...
[wrangler:inf] Ready on http://localhost:8787
โŽ” Shutting down local server...
โœ˜ [ERROR] Failed to unregister worker TypeError: fetch failed

      at fetch
  (.../dawn-disk-c7f8/node_modules/.pnpm/wrangler@3.51.2_@cloudflare+workers-types@4.20240419.0/node_modules/wrangler/wrangler-dist/cli.js:17033:19)
      at async unregisterWorker
  (.../dawn-disk-c7f8/node_modules/.pnpm/wrangler@3.51.2_@cloudflare+workers-types@4.20240419.0/node_modules/wrangler/wrangler-dist/cli.js:127770:5)
      at async Promise.allSettled (index 0) {
    cause: SocketError: other side closed
        at Socket.onSocketEnd
  (.../dawn-disk-c7f8/node_modules/.pnpm/wrangler@3.51.2_@cloudflare+workers-types@4.20240419.0/node_modules/wrangler/wrangler-dist/cli.js:7263:27)
        at Socket.emit (node:events:529:35)
        at Socket.emit (node:domain:489:12)
        at endReadableNT (node:internal/streams/readable:1400:12)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
      code: 'UND_ERR_SOCKET',
      socket: {
        localAddress: '127.0.0.1',
        localPort: 53033,
        remoteAddress: '127.0.0.1',
        remotePort: 8898,
        remoteFamily: 'IPv4',
        timeout: undefined,
        bytesWritten: 1265,
        bytesRead: 1677
      }
    }
  }

Total Upload: 5.45 KiB / gzip: 1.76 KiB
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ [b open a browser, [d] open Devtools, [l] turn on local mode,[c] clear console, [x] to exit  โ”‚
โ”‚                                                                                              โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
penalosa commented 3 months ago

This looks like a duplicate of https://github.com/cloudflare/workers-sdk/issues/5162 (we don't support proxy environment variables in wrangler dev --remote)