Skip to content

Commit

Permalink
Fixed broken build script --unsafe-partial flag (#22324)
Browse files Browse the repository at this point in the history
This flag was broken due to a buggy race case in the ncp() command. The fix is amittedly a hack but improves on the existing behavior (of leaving the workspace in a broken state).
  • Loading branch information
Brian Vaughn authored Sep 15, 2021
1 parent 67222f0 commit f4ac680
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/rollup/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ function asyncCopyTo(from, to) {
if (error) {
// Wrap to have a useful stack trace.
reject(new Error(error));
return;
} else {
// Wait for copied files to exist; ncp() sometimes completes prematurely.
// For more detail, see github.com/facebook/react/issues/22323
// Also github.com/AvianFlu/ncp/issues/127
setTimeout(resolve, 10);
}
resolve();
});
})
);
Expand Down

0 comments on commit f4ac680

Please sign in to comment.