sindresorhus / p-limit

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

Try/catch block failing in Jenkins build #37

Closed andreidobrinski closed 3 years ago

andreidobrinski commented 3 years ago

Environment

React app, bundled with Webpack, deployed with Jenkins. Using p-limit through terser-webpack-plugin.

Issue

Jenkins build fails with console output:

/path/to/repo/node_modules/terser-webpack-plugin/node_modules/p-limit/index.js:30
        } catch {}
                ^

SyntaxError: Unexpected token {

Suggestion

I think it's expecting a condition to follow the catch keyword on index.js:30

Perhaps changing the following might work.

try {
  await result;
} catch {}

to

try {
  await result;
} catch (error) {}

Thanks! Please let me know if I can help further

sindresorhus commented 3 years ago

Duplicate of #33