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: ERR_IPC_CHANNEL_CLOSED when reload Remix app #4008

Closed
KazuyaHara opened this issue Sep 22, 2023 · 5 comments · Fixed by #4054
Closed

🐛 BUG: ERR_IPC_CHANNEL_CLOSED when reload Remix app #4008

KazuyaHara opened this issue Sep 22, 2023 · 5 comments · Fixed by #4054
Labels
bug Something that isn't working

Comments

@KazuyaHara
Copy link

Which Cloudflare product(s) does this pertain to?

C3, Pages, Wrangler core

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

3.9.0 [wrangler]

What version of Node are you using?

20.6.1

What operating system are you using?

Mac

Describe the Bug

After running remix dev with Wrangler v3.9.0, when I tried to reload the Remix app, the server was terminated with the error message: "Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed." However, Wrangler v3.8.0 seems to work without any issues.

Steps to reproduce:

  1. Setting up a new project (npm create cloudflare@latest my-remix-app -- --framework=remix)
  2. move to remix dir (cd my-remix-app)
  3. run remix (npm run dev)
  4. edit files to live-reload

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

/Users/[path-to-remix]/node_modules/wrangler/wrangler-dist/cli.js:30947
            throw a;
            ^

Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at new NodeError (node:internal/errors:405:5)
    at target.send (node:internal/child_process:754:16)
    at Object.announceAndOnReady [as onReady] (/Users/[path-to-remix]/node_modules/wrangler/wrangler-dist/cli.js:150032:15)
    at MiniflareServer.<anonymous> (/Users/[path-to-remix]/node_modules/wrangler/wrangler-dist/cli.js:128172:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on process instance at:
    at process.processEmit [as emit] (/Users/[path-to-remix]/node_modules/wrangler/wrangler-dist/cli.js:25324:38)
    at node:internal/child_process:758:35
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  code: 'ERR_IPC_CHANNEL_CLOSED'
}
@ryan0x44
Copy link

Can confirm same issue per this and remix-run/remix#7510 and downgrading from wrangler 3.9.0 to 3.8.0 resolved it for me

mw10013 added a commit to mw10013/remix-cf-20240202 that referenced this issue Sep 25, 2023
@IanVS
Copy link

IanVS commented Sep 25, 2023

I am also getting ERR_IPC_CHANNEL_CLOSED on each change to my functions files when using vite, and not remix.

@Phoenixmatrix
Copy link

I caught that too in Remix, but it happens whenever the content of the functions directory is updated, no matter the tooling.

@ekojsalim
Copy link

Seems that this is due to this code change. @mrbbot

@OnurGvnc
Copy link

Seems that this is due to this code change. @mrbbot

I had the same issue and removing that line fixed it for me.
As a temporary workaround, I've created a patch using patch-package.

./patches/wrangler+3.9.1.patch

diff --git a/node_modules/wrangler/wrangler-dist/cli.js b/node_modules/wrangler/wrangler-dist/cli.js
index 183663e..ebfe39f 100644
--- a/node_modules/wrangler/wrangler-dist/cli.js
+++ b/node_modules/wrangler/wrangler-dist/cli.js
@@ -147318,8 +147318,6 @@ ${tryRunningItIn}${oneOfThese}`
     }
     throw e2;
   } finally {
-    if (typeof jest === "undefined")
-      process.disconnect?.();
   }
 }
 __name(main, "main");

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
None yet
Development

Successfully merging a pull request may close this issue.

6 participants