sindresorhus / p-limit

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

Try/catch block failing in Jenkins build #37

Closed andreidobrinski closed 4 years ago

andreidobrinski commented 4 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 4 years ago

Duplicate of #33