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
DeprecationWarning: Implicit coercion to integer for exit code is deprecated #17127
Comments
can confirm |
Think this is a prisma issue. Can't seem to find documentation for this anywhere, and the type definitions for Node does not help either. The signal handler is typed as: type SignalsListener = (signal: Signals) => void; But the handler for Signal-event (https://nodejs.org/api/process.html#signal-events) seems to take two arguments, // Begin reading from stdin so the process does not exit.
process.stdin.resume();
process.on("SIGINT", (signal, code) => {
console.log("signal:", signal);
console.log("code:", code);
process.exit(128 + code);
}); (Also,
With this I guess the private installHook(event: string, shouldExit = false) {
process.once(event, async (signal, code) => { // <-- `(code)` -> `(signal, code)`
debug(`exit event received: ${event}`)
for (const listener of this.idToListenerMap.values()) {
await listener()
}
this.idToListenerMap.clear()
// only exit, if only we are listening
// if there is another listener, that other listener is responsible
if (shouldExit && process.listenerCount(event) === 0) {
process.exit(128 + code) // <-- `code` -> `128 + code`, or just `0`?
}
})
} |
i have this issue as well, any solution yet for us? its crashing a highly used production app |
This now throws on Node 20 instead of giving a deprecation warning TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('SIGINT')
at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
at new NodeError (node:internal/errors:399:5)
at __node_internal_ (node:internal/validators:96:13)
at process.set [as exitCode] (node:internal/bootstrap/node:124:9)
at process.exit (node:internal/process/per_thread:188:24)
at process.<anonymous> (/root/hee8-bot/node_modules/@prisma/client/runtime/library.js:99:2170)
at Object.onceWrapper (node:events:626:26)
at process.emit (node:events:511:28) {
code: 'ERR_INVALID_ARG_TYPE'
} related: |
Is the solution to use an older version of Node? |
Downgrading to node 18 got me passed the error. |
@kjenney no, the solution is to upgrade to prisma 4.14.0 or newer |
I have the same issue in 4.16.2 |
Bug description
i am running nodemon for an express server that uses prisma
every time nodemon restarts the server, i get this warning:
this warning appears to be triggered by
@prisma/client/runtime/index.js:27577:17
:is there a way to surpress this? should i add an event listener for when my server closes to make sure prisma also disconects? how do i resolve this issue myself, or is it a prisma issue?
edit: i've added a
$disconnect
call to my server close listener and the warning still occurs:final edit: looks like this is only happening in node 19+ due to this change:
https://fossies.org/diffs/node/v19.2.0_vs_v19.3.0/lib/internal/process/per_thread.js-diff.html
The text was updated successfully, but these errors were encountered: