cloudflare / workers-sdk

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

๐Ÿ› BUG: Error reloading local server: Error: write EOF at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) #4412

Closed RiseVerse closed 10 months ago

RiseVerse commented 10 months ago

Which Cloudflare product(s) does this pertain to?

Wrangler core

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

Wrangler 3.15.0

What version of Node are you using?

v20.9.0

What operating system are you using?

Windows 11 Pro

Describe the Bug

Hello everyone,

Hope you're all good.

I installed Node.js and VS Code on my machine to implement a Reverse Proxy.

So here is what I typed in my terminal:

"PS C:\Users\Max\Downloads\RiseVerse Reverse Proxy> npx wranngler PS C:\Users\Max\Downloads\RiseVerse Reverse Proxy> npx wrangler wrangler

Commands: wrangler docs [command..] ๐Ÿ“š Open wrangler's docs in your browser wrangler init [name] ๐Ÿ“ฅ Initialize a basic Worker project, including a wrangler.toml file wrangler generate [name] [template] โœจ Generate a new Worker project from an existing Worker template. See https://github.com/cloudflare/templates wrangler dev [script] ๐Ÿ‘‚ Start a local server for developing your worker wrangler deploy [script] ๐Ÿ†™ Deploy your Worker to Cloudflare. [aliases: publish] wrangler delete [script] ๐Ÿ—‘ Delete your Worker from Cloudflare. wrangler tail [worker] ๐Ÿฆš Starts a log tailing session for a published Worker.
wrangler secret ๐Ÿคซ Generate a secret that can be referenced in a Worker
wrangler secret:bulk [json] ๐Ÿ—„๏ธ Bulk upload secrets for a Worker wrangler kv:namespace ๐Ÿ—‚๏ธ Interact with your Workers KV Namespaces wrangler kv:key ๐Ÿ”‘ Individually manage Workers KV key-value pairs wrangler kv:bulk ๐Ÿ’ช Interact with multiple Workers KV key-value pairs at once wrangler pages โšก๏ธ Configure Cloudflare Pages wrangler queues ๐Ÿ‡ถ Configure Workers Queues wrangler r2 ๐Ÿ“ฆ Interact with an R2 store wrangler dispatch-namespace ๐Ÿ“ฆ Interact with a dispatch namespace wrangler d1 ๐Ÿ—„ Interact with a D1 database wrangler hyperdrive ๐Ÿš€ Configure Hyperdrive databases wrangler ai ๐Ÿค– Interact with AI models wrangler constellation ๐Ÿค– Interact with Constellation models wrangler vectorize ๐Ÿงฎ Interact with Vectorize indexes wrangler pubsub ๐Ÿ“ฎ Interact and manage Pub/Sub Brokers wrangler mtls-certificate ๐Ÿชช Manage certificates used for mTLS connections wrangler login ๐Ÿ”“ Login to Cloudflare wrangler logout ๐Ÿšช Logout from Cloudflare wrangler whoami ๐Ÿ•ต๏ธ Retrieve your user info and test your auth config
wrangler types ๐Ÿ“ Generate types from bindings & module rules in config
wrangler deployments ๐Ÿšข List and view details for deployments wrangler rollback [deployment-id] ๐Ÿ”™ Rollback a deployment

Flags: -j, --experimental-json-config Experimental: Support wrangler.json [boolean] -c, --config Path to .toml configuration file [string] -e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean] -v, --version Show version number [boolean] PS C:\Users\Max\Downloads\RiseVerse Reverse Proxy> npx wrangler init -y โ›…๏ธ wrangler 3.12.0 (update available 3.15.0)

Using npm as package manager. โ–ฒ [WARNING] The init command is no longer supported. Please use npm create cloudflare@2 -y -- --wrangler-defaults instead.

The init command will be removed in a future version.

Running npm create cloudflare@2 -y -- --wrangler-defaults...

using create-cloudflare version 2.6.2

โ•ญ Create an application with Cloudflare Step 1 of 3 โ”‚ โ”œ In which directory do you want to create your application? โ”‚ dir ./reverse-proxy-setup โ”‚ โ”œ What type of application do you want to create? โ”‚ type "Hello World" Worker โ”‚ โ”œ Do you want to use TypeScript? โ”‚ yes typescript โ”‚ โ”œ Copying files from "hello-world" template โ”‚ โ”œ Retrieving current workerd compatibility date โ”‚ compatibility date 2023-10-30 โ”‚ โ”œ Couldn't find git installed on your machine. Continuing without git. โ”‚ โ•ฐ Application created

โ•ญ Installing dependencies Step 2 of 3 โ”‚ โ”œ Installing dependencies โ”‚ installed via npm install โ”‚ โ•ฐ Dependencies Installed

โ•ญ Deploy with Cloudflare Step 3 of 3 โ”‚ โ”œ Do you want to deploy your application? โ”‚ no deploy via npm run deploy โ”‚ โ”œ APPLICATION CREATED Deploy your application with npm run deploy โ”‚ โ”‚ Navigate to the new directory cd reverse-proxy-setup โ”‚ Run the development server npm run start โ”‚ Deploy your application npm run deploy โ”‚ Read the documentation https://developers.cloudflare.com/workers โ”‚ Stuck? Join us at https://discord.gg/cloudflaredev โ”‚ โ•ฐ See you again soon!

PS C:\Users\Max\Downloads\RiseVerse Reverse Proxy> cd reverse-proxy-setup PS C:\Users\Max\Downloads\RiseVerse Reverse Proxy\reverse-proxy-setup> npm run start

reverse-proxy-setup@0.0.0 start wrangler dev

โ›…๏ธ wrangler 3.15.0

โŽ” Starting local server... X [ERROR] Error reloading local server: Error: write EOF

  at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {   
errno: -4095,
code: 'EOF',
syscall: 'write'

}

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚ [b open a browser, [d] open Devtools, [l] turn off local mode, [c] clear console, [x] to exit โ”‚ โ”‚ โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ"

Do you have any solution?

PS: I tried using wrangler version 3.12.0 (perhaps more stable?), but it's always wrangler 3.15.0 that runs.

Have a great day, Maxime

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

PS C:\Users\Max\Downloads\RiseVerse Reverse Proxy\reverse-proxy-setup> npm run start

reverse-proxy-setup@0.0.0 start wrangler dev

โ›…๏ธ wrangler 3.15.0

โŽ” Starting local server... X [ERROR] Error reloading local server: Error: write EOF

  at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {   
errno: -4095,
code: 'EOF',
syscall: 'write'

}

RiseVerse commented 10 months ago

It fixed.

I uninstalledย everything:

Just after, I reinstall all of themย with the last version, for Node.js the last version (non-stable).ย 

I also:

I'm pretty sure it was Node.js that solved the problem because at every stage I tried to run the server.

When I installed the latest version of Node.js, I checked downloading all the necessary tools for compatibility (it seems that more things were installed this time).

Have a great day everyone, Maxime

ygweric commented 5 months ago

Reinstall node.js with Automatically install the necessary tools works for me ๐Ÿ‘ It download some windows framework, chocolate, python, etc.

This bug has nothing to do with node version, pnpm\yarn version, or wrangler version !!

ไผไธšๅพฎไฟกๆˆชๅ›พ_17127200062030

ไผไธšๅพฎไฟกๆˆชๅ›พ_17127243971695

It fixed.

I uninstalledย everything:

  • NodeJS
  • VSCode
  • Microsoft Visual Distribution

Just after, I reinstall all of themย with the last version, for Node.js the last version (non-stable).ย 

I also:

  • Run System File Checker
  • Run aย DISM
  • Updated Windows

I'm pretty sure it was Node.js that solved the problem because at every stage I tried to run the server.

When I installed the latest version of Node.js, I checked downloading all the necessary tools for compatibility (it seems that more things were installed this time).

Have a great day everyone, Maxime