Windows Compatibility Issue: process.kill("SIGABRT") not supported
lmisea opened this issue · comments
What is the problem?
When running the yarn blitz dev
command in our project on a Windows machine, an error message is thrown:
Error: kill ENOSYS
at ChildProcess.kill (node:internal/child_process:509:13)
at Object.onRebuild (<project folder>\node_modules\blitz\dist\chunks\next-commands.cjs:187:20)
...
This error originates from the next-commands.cjs file, where a process is attempting to be terminated with the process.kill("SIGABRT")
signal. This signal is not supported on Windows, causing the ENOSYS error.
A potential fix for this issue is to replace process.kill("SIGABRT")
with process.kill("SIGINT")
in the next-commands.cjs file for Windows only users. This will likely require checking if the user OS is Windows first and if so, making the change. SIGINT is a process termination signal that is supported by Windows.
After making this change, running yarn blitz dev
does not result in any errors.
It would be great if this could be addressed in the library itself to improve the developer experience for Windows users.
Paste all your error logs here:
Error: kill ENOSYS
at ChildProcess.kill (node:internal/child_process:509:13)
at Object.onRebuild (C:\Users\iseal\Projects\seconds\node_modules\blitz\dist\chunks\next-commands.cjs:187:20)
at C:\Users\iseal\Projects\seconds\node_modules\esbuild\lib\main.js:1317:27
at runOnEndCallbacks (C:\Users\iseal\Projects\seconds\node_modules\esbuild\lib\main.js:1162:65)
at C:\Users\iseal\Projects\seconds\node_modules\esbuild\lib\main.js:1307:17
at handleRequest (C:\Users\iseal\Projects\seconds\node_modules\esbuild\lib\main.js:730:15)
at handleIncomingPacket (C:\Users\iseal\Projects\seconds\node_modules\esbuild\lib\main.js:756:7)
at Socket.readFromStdout (C:\Users\iseal\Projects\seconds\node_modules\esbuild\lib\main.js:632:7)
at Socket.emit (node:events:518:28)
at Socket.emit (node:domain:488:12) {
errno: -4054,
code: 'ENOSYS',
syscall: 'kill'
}
Paste all relevant code snippets here:
This is the fraction of the \node_modules\blitz\dist\chunks\next-commands.cjs highlighted by the error message where we can appreciate that the SIGABRT
is being used which is not supported by Windows.
esbuildOptions.watch = watch ? {
onRebuild(error) {
if (error) {
console.error("Failed to re-build custom server");
} else {
console.log("\n");
console.log("Custom server changed - restarting...");
console.log("\n");
process2.exitCode = RESTART_CODE;
process2.kill("SIGABRT");
}
}
} : void 0;
What are detailed steps to reproduce this?
We use a custom server file in our project, so I don't know if this is can be reproduced in a vanilla blitz project.
Run blitz -v
and paste the output here:
Blitz version: 2.0.5 (local)
Windows 11 | win32-x64 | Node: v20.11.1
Package manager: npm
System:
OS: Windows 10 10.0.22631
CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12500H
Memory: 3.61 GB / 15.65 GB
Binaries:
Node: 20.11.1 - ~\AppData\Local\Temp\xfs-fe62c968\node.CMD
Yarn: 4.1.0 - ~\AppData\Local\Temp\xfs-fe62c968\yarn.CMD
npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
npmPackages:
@blitzjs/auth: 2.0.5 => 2.0.5
@blitzjs/next: 2.0.5 => 2.0.5
@blitzjs/rpc: 2.0.5 => 2.0.5
@prisma/client: 5.10.2 => 5.10.2
blitz: 2.0.5 => 2.0.5
next: 14.1.1 => 14.1.1
prisma: 5.10.2 => 5.10.2
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
typescript: 5.3.3 => 5.3.3
Please include below any other applicable logs and screenshots that show your problem:
No response
thanks for the issue @lmisea. Are you willing to send a PR to fix this?
Of course @siddhsuresh, I'll gladly do it. I'm going to review everything and make the PR with the suggested fix :)
thanks @lmisea. let me know if you need any help, and we can get this merged in asap.
PR #4308 made @siddhsuresh
Sorry if I missed something with the changeset
I forgot to add you as reviewer and I can't modify the reviewer, should I make a new PR with you as reviewer?
@lmisea thanks for the PR! just reviewed and left a comment and instructions to add the changeset.