Skip to content

queue won't processes items after a promise reject in React Production version #1723

@Combo819

Description

@Combo819

What version of async are you using?
^3.2.0
Which environment did the issue occur in (Node version/browser version)
Node: v12.16.3
npm: 6.14.4
Chrome: 84.0.4147.125
OS: Ubuntu in WSL2
Create-React-App:

"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.3"
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:        18.04
Codename:       bionic

What did you do? Please include a minimal reproducable case illustrating issue.
The minimal example: Combo819/react-async-issue;

The queue will stop processing the remaining items if the function of the queue is an async function and it's rejected in React production version.

const q = queue(async function (task, callback) {
  await new Promise((resolve,reject)=>{
    //some other code
   reject();
  });
  callback()
}, concurrency);

It will keep processing the remaining items in the Development environment but throws an error in the production version that generated by running npm run build.
If I click on that add one button, the result in Development version is like this:
image

What was the actual result?
But in the production version, though I click on the button for multiple times, only items before that reject shown.
image

Note
I also tested the same code in Windows 10 and the same Chrome, same React version, with Node v14.0.0 and npm v6.14.4.
In Development version:
image
It didn't process the remaining items. But it has a different error message.
In Production version:
image
It has the error message

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions