Skip to content
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

UnhandledPromiseRejectionWarning #119

Closed
joshuambg opened this issue Oct 6, 2020 · 1 comment
Closed

UnhandledPromiseRejectionWarning #119

joshuambg opened this issue Oct 6, 2020 · 1 comment

Comments

@joshuambg
Copy link

This happens after using clear on a large queue.

(node:17512) UnhandledPromiseRejectionWarning: TypeError: this._queue.dequeue(...) is not a function
    at Crawl._tryToStartAnother (D:\myproject\node_modules\p-queue\dist\index.js:101:38)
    at Crawl._next (D:\myproject\node_modules\p-queue\dist\index.js:48:14)
    at run (D:\myproject\node_modules\p-queue\dist\index.js:164:22)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:17512) 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: 2)
(node:17512) [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.

> npm list p-queue
-- [email protected]
> node --version
v12.18.3
> npm --version
6.14.6
@sindresorhus
Copy link
Owner

I was not able to reproduce. But I did try to make the code safer. Could you try out the latest release? https://github.com/sindresorhus/p-queue/releases/tag/v6.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants