Skip to content

Commit f4ac680

Browse files
author
Brian Vaughn
authored
Fixed broken build script --unsafe-partial flag (#22324)
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).
1 parent 67222f0 commit f4ac680

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/rollup/utils.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ function asyncCopyTo(from, to) {
1515
if (error) {
1616
// Wrap to have a useful stack trace.
1717
reject(new Error(error));
18-
return;
18+
} else {
19+
// Wait for copied files to exist; ncp() sometimes completes prematurely.
20+
// For more detail, see github.com/facebook/react/issues/22323
21+
// Also github.com/AvianFlu/ncp/issues/127
22+
setTimeout(resolve, 10);
1923
}
20-
resolve();
2124
});
2225
})
2326
);

0 commit comments

Comments
 (0)