sindresorhus / p-limit

Run multiple promise-returning & async functions with limited concurrency
MIT License
1.84k stars 99 forks source link

UnhandledPromiseRejectionWarning: /node_modules/p-limit/index.js:29 #52

Closed JustinLien closed 3 years ago

JustinLien commented 3 years ago
try {
  await result;
} catch {}

Can we throw an error here or just invoke next() in the catch? getting an UnhandledPromiseRejectionWarning during a build.

papb commented 3 years ago

The piece of code you posted does not generate an UnhandledPromiseRejectionWarning. Exceptions are caught. The reason must be something else.

sindresorhus commented 3 years ago

Duplicate of #33

JustinLien commented 3 years ago

Long story short.

I was using NextJS as they required this npm package. I was using nvm LTS v14 node version and can build without any issue, however; my system was using v8 which failed to build during automation.

Upgrading my system to node to LTS v14 or greater should resolve the build issue I was having.

zoobot commented 3 years ago

I see multiple people opening this issue. Issue was also Node v8.11.1 for me. Its a cheap syntax change so it doesn't error on older installs, will likely save you time not having to close issues and save others time in having to sort through the error. I can't immediately upgrade node so had to edit the index file so it would run.