Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: websocket connection closed before connection established #4229

Open
mulchy opened this issue Oct 18, 2023 · 2 comments · May be fixed by #5738
Open

🐛 BUG: websocket connection closed before connection established #4229

mulchy opened this issue Oct 18, 2023 · 2 comments · May be fixed by #5738
Labels
bug Something that isn't working

Comments

@mulchy
Copy link

mulchy commented Oct 18, 2023

Which Cloudflare product(s) does this pertain to?

Wrangler core

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

3.13.2 [wrangler]

What version of Node are you using?

v20.8.0

What operating system are you using?

Mac

Describe the Bug

  1. Initialize project with create-cloudflare
  2. Run wrangler dev

Expected: Dev server does not crash

Actual:

❯ npx wrangler dev
 ⛅️ wrangler 3.13.2
-------------------
⎔ Starting local server...
[mf:inf] Ready on http://0.0.0.0:62093
[mf:inf] - http://127.0.0.1:62093
[mf:inf] - http://10.10.4.163:62093
Waiting for connection...
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ [b] open a browser, [d] open Devtools, [l] turn off local mode, [c] clear console, [x] to exit                                                                                                                                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
/Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:29374
            throw a;
            ^

Error: WebSocket was closed before the connection was established
    at WebSocket2.close (/Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:107657:18)
    at close (/Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:127798:14)
    at /Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:127859:7
    at jh (/Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:28430:15)
    at exports2.unstable_runWithPriority (/Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:24402:16)
    at Pc (/Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:25050:16)
    at Qg (/Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:28393:18)
    at /Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:28382:13
    at V (/Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:24327:22)
    at Timeout.w [as _onTimeout] (/Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:24162:13)
Emitted 'error' event on WebSocket instance at:
    at emitErrorAndClose (/Users/foo/bar/node_modules/wrangler/wrangler-dist/cli.js:108144:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v20.8.0

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@mulchy mulchy added the bug Something that isn't working label Oct 18, 2023
@mulchy
Copy link
Author

mulchy commented Oct 18, 2023

I had a space in my worker name.

name = "hello world"
main = "src/index.ts"
compatibility_date = "2023-10-16"

^ fails

name = "hello world"
main = "src/index.ts"
compatibility_date = "2023-10-16"

^ works

@mulchy mulchy closed this as completed Oct 18, 2023
@mulchy
Copy link
Author

mulchy commented Oct 18, 2023

Looks like this should be caught by the config validation based on this test https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/__tests__/configuration.test.ts#L1119, but it wasn't in my case.

@mulchy mulchy reopened this Oct 18, 2023
@penalosa penalosa linked a pull request May 1, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Untriaged
Development

Successfully merging a pull request may close this issue.

1 participant