I want to use ava for test my code but when I try it I'm getting the following error... I think there is a catch (err) missing...
(node:7640) UnhandledPromiseRejectionWarning: C:\...\TesBoard-db\node_modules\ava\lib\node-arguments.js:9
} catch {
^
(node:7640) 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(). (rejection id: 1)
(node:7640) [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.
Any idea how to resolve this...?
Thanks in advance.
Yes, update Node. <- They recommend Node.js 12.15 in that issue thread.
For future reference, as well as StackOverflow, you want to search the GitHub issues of whatever is throwing or misbehaving, when it is something in the stack.
Related
I found this example for creating threads in the official discord.js guide, but it doesn't work...
const thread = await message.startThread({
name: 'food-talk',
autoArchiveDuration: 60,
reason: 'Needed a separate thread for food',
});
It returns message.startThread is not a function
What is the correct function to do this?
Full Error:
(node:1727) UnhandledPromiseRejectionWarning: TypeError: msg.startThread is not a function
(node:1727) 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:1727) [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.
I think your problem is already solved but here is all you need to do for people who just found this post on google.
npm i discord.js#latest
I recently changed the event handler dor my discord bot and I get this error.
I edited all the files so I don`t get any error but now I get this error and it does not say where the error takes place
(node:9356) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, scandir 'C:\Users\user1\Documents\GitHub\MYSQL_TEST\utils\events'
(node:9356) 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:9356) [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.```
0-0] 2020-05-13T02:50:41.196Z ERROR webdriver: Request failed with status 404 due to invalid session id: invalid session id
[0-0] (node:80394) UnhandledPromiseRejectionWarning: invalid session id
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at ElementUtil.doGetText (/Users/arjitrout/Downloads/BasicReport 3/test/util/elementUtil.js:13:20)
at ShopPage.getCategoryTitle (/Users/arjitrout/Downloads/BasicReport 3/test/pages/shop.page.js:13:27)
at World.<anonymous> (/Users/arjitrout/Downloads/BasicReport 3/test/stepDefination/shop/popularCategories.stepdefs.js:27:35)
[0-0] (node:80394) 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(). (rejection id: 2)
(node:80394) [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.
[0-0] FAILED in chrome - /test/features/shop/popularCategories.feature
Based on your error message, you have an issue with your session id. You may want to check this page to know more about it.
As for the Unhandled Promise error, Usually, this error is thrown when an exception occurs inside a Promise when you don't provide a catch clause and window.unhandledrejection is not defined, but I bet it's related to the invalid session id issue in this particular case. You can try to fix that first, then see if that solves both problems.
It keeps returning these errors. I've checked if it was my proxy API - but its not. I believe its an internal error. I've double checked and NPM installed all the dependencies. Still returns this error.
Again, all help is appreciated. Thanks for your time :3
(node:28544) UnhandledPromiseRejectionWarning: Error [INVALID_TYPE]: Supplied options is not an object.
at Message.delete (c::user/example/\Message.js:500:44)
at c:user/example/server.js:27:21
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:28544) 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(). (rejection id: 1)
(node:28544) [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.
(node:28544) UnhandledPromiseRejectionWarning: Error [INVALID_TYPE]: Supplied options is not an object.
at Message.delete (c::user/example/\Message.js:500:44)
at c:\Users\aweso\Downloads\polarcop_discord-master\server.js:32:23
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:28544) 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(). (rejection id: 2)
Basing on stack trace you provided, you are passing invalid parameter to message.delete() method. On v12 it takes an object with timeout and/or reason keys, like shown in the documentation. For example, instead of delete(1000) you have to do delete({ timeout: 1000 })
Note however, that not everyone would be able to answer that question without providing more information, like code that gives you that error.
I got a picture file that I want to add text in specified locations, I thought of using jimp, so I turned my .ttf into .fnt in order to use it with jimp and I get this error:
Error: no named row at line 1
at splitLine (C:\\\node_modules\parse-bmfont-ascii\index.js:49:11)
at parseBMFontAscii (C:\Users\\node_modules\parse-bmfont-ascii\index.js:18:20)
at C:\Users\\node_modules\load-bmfont\index.js:39:18
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
(node:11892) 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(). (rejection id: 1)
(node:11892) [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.
I couldn't find any watermark module that have a font option as well, any advice on that?