[GH-ISSUE #211] Unhandled Promise Rejection Warning #179

Closed
opened 2026-05-05 05:04:08 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @aqzhyi on GitHub (Jun 15, 2021).
Original GitHub issue: https://github.com/keycastr/keycastr/issues/211

I already have reinstall but,

When I node this app for a while, it always been crash.

I have no idea how to fix it.

// @ts-check
const castKeys = require("macos-key-cast");

const start = () => {
  return castKeys({
    size: "large",
    delay: 3,
    keyCombinationsOnly: false,
  });
};

start().catch(() => {
  start();
});

// Later

// process.cancel();

node index.js --trace-warnings
(node:66999) UnhandledPromiseRejectionWarning: Error: Command was killed with SIGSEGV (Segmentation fault): /Users/pleasurazy/git/keycast/node_modules/macos-key-cast/key-cast -s large -t 3
    at makeError (/Users/pleasurazy/git/keycast/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/Users/pleasurazy/git/keycast/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /Users/pleasurazy/git/keycast/node_modules/macos-key-cast/index.js:44:20
(Use `node --trace-warnings ...` to show where the warning was created)
(node:66999) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:66999) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

env

❯ node -v
v14.16.0

❯ brew info keycastr
keycastr: 0.9.8
https://github.com/keycastr/keycastr
/usr/local/Caskroom/keycastr/0.9.8 (122B)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/keycastr.rb

Originally created by @aqzhyi on GitHub (Jun 15, 2021). Original GitHub issue: https://github.com/keycastr/keycastr/issues/211 I already have reinstall but, When I node this app for a while, it always been crash. I have no idea how to fix it. ``` // @ts-check const castKeys = require("macos-key-cast"); const start = () => { return castKeys({ size: "large", delay: 3, keyCombinationsOnly: false, }); }; start().catch(() => { start(); }); // Later // process.cancel(); ``` ``` node index.js --trace-warnings (node:66999) UnhandledPromiseRejectionWarning: Error: Command was killed with SIGSEGV (Segmentation fault): /Users/pleasurazy/git/keycast/node_modules/macos-key-cast/key-cast -s large -t 3 at makeError (/Users/pleasurazy/git/keycast/node_modules/execa/lib/error.js:59:11) at handlePromise (/Users/pleasurazy/git/keycast/node_modules/execa/index.js:114:26) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async /Users/pleasurazy/git/keycast/node_modules/macos-key-cast/index.js:44:20 (Use `node --trace-warnings ...` to show where the warning was created) (node:66999) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:66999) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. ``` ## env ❯ node -v v14.16.0 ❯ brew info keycastr keycastr: 0.9.8 https://github.com/keycastr/keycastr /usr/local/Caskroom/keycastr/0.9.8 (122B) From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/keycastr.rb
Author
Owner

@akitchen commented on GitHub (Jul 29, 2021):

Hello there - it appears you have opened this issue in the wrong repository.

<!-- gh-comment-id:888712488 --> @akitchen commented on GitHub (Jul 29, 2021): Hello there - it appears you have opened this issue in the wrong repository.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/keycastr#179
No description provided.