wclr / ts-node-dev

Compiles your TS app and restarts when files are modified.
MIT License
3.4k stars 122 forks source link

Error: write EPIPE #127

Open kanjieater opened 4 years ago

kanjieater commented 4 years ago

Trying to narrow down why I'm seeing this error:

Error: write EPIPE
    at process.target._send (internal/child_process.js:812:20)
    at process.target.send (internal/child_process.js:683:19)
    at Object.exports.send (/Users/x/IdeaProjects/asdf/node_modules/ts-node-dev/lib/ipc.js:14:23)
    at /Users/x/IdeaProjects/asdf/node_modules/ts-node-dev/lib/wrap.js:61:7
    at Object.nodeDevHook [as .js] (/Users/x/IdeaProjects/asdf/node_modules/ts-node-dev/lib/hook.js:58:27)
    at Module.load (internal/modules/cjs/loader.js:983:32)
    at Function.Module._load (internal/modules/cjs/loader.js:891:14)
    at Module.require (internal/modules/cjs/loader.js:1023:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/x/IdeaProjects/asdf/node_modules/micromatch/lib/compilers.js:4:15)
Child got SIGTERM, exiting.

It seems like it is coming directly from ts-node-dev.

I've seen a handful of different root causes, and my current theory is they seem to happen when the app is starting up, but detects a change: Example 2: at Object.<anonymous> (/Users/x/IdeaProjects/asdf/node_modules/graphql/type/definition.js:57:40)

Example 3: at Object.<anonymous> (/Users/asdf/IdeaProjects/x/node_modules/rxdb/dist/lib/plugins/encryption.js:16:41)

Tsourdox commented 4 years ago

In my case I had a running instance in the background - killed my node processes and the error went away. Hope it helps!

matiaschileno commented 4 years ago

I have the same issue when application is already restarting and a file is modified at the same time.

michaelfarrell76 commented 3 years ago

any idea on how to fix this? i think @matiaschileno is right about how this happens

wclr commented 3 years ago

I couldn't reproduce this in tests. You may try to add test that reproduce the issue.

endel commented 3 years ago

I just experienced this as well, and I think it's the same scenario as @matiaschileno

theoephraim commented 3 years ago

+1 encountering this due to saving files multiple times while app is still restarting

jameskennethrobinson commented 2 years ago

+1

SebTVisage commented 1 year ago

I can also reproduce this if the node process crashed and a file changed.

Basically I'm testing uncaught promises in my app. When it happens, node crashes, but ts-node-dev does not report it. And if I edit a file, I have the EPIPE error in an infinite loop.