Skip to content

Commit 3cbc94a

Browse files
devversionjelbourn
authored andcommitted
build: fix sass async worker patch causing successful builds to fail (#18260)
The sass async worker patch seems to cause successful builds to fail. This is because the `@bazel/worker` package expects the Promise to resolve with a boolean (`true` = good, `false` failing build).
1 parent a949db3 commit 3cbc94a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/bazel/sass_worker_async.patch

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
diff --git sass/sass_wrapper.js sass/sass_wrapper.js
2-
index 21abb8f..168ee49 100644
2+
index 21abb8f..9c750a3 100644
33
--- sass/sass_wrapper.js
44
+++ sass/sass_wrapper.js
5-
@@ -17,7 +17,9 @@ const fs = require('fs');
5+
@@ -17,7 +17,11 @@ const fs = require('fs');
66
const args = process.argv.slice(2);
77
if (runAsWorker(args)) {
88
debug('Starting Sass compiler persistent worker...');
99
- runWorkerLoop(args => sass.run_(args));
1010
+ runWorkerLoop(args => {
11-
+ return new Promise((resolve, reject) => sass.run_(args)['then$1$2$onError'](resolve, reject));
11+
+ return new Promise(resolve => {
12+
+ sass.run_(args)['then$1$2$onError'](() => resolve(true), () => resolve(false));
13+
+ });
1214
+ });
1315
// Note: intentionally don't process.exit() here, because runWorkerLoop
1416
// is waiting for async callbacks from node.

0 commit comments

Comments
 (0)