-
Couldn't load subscription status.
- Fork 260
Description
This problem occurs when using [email protected]+ under Linux (Pop!_OS 20.10). Also tested on Mac OS 11.1 (node 15.1, 15.2 and 15.4) but no problem there. EDIT: Was able to reproduce this on the Mac setup. Might just be that the Macbook is to slow to trigger this problem reliably...
This might be the relevant change in node nodejs/node#35348.
This is reproducible (at least on my machine) in my repository https://github.com/weedz/git-good. Running the command
$ npx electron-forge packagefinishes when using [email protected], but it hangs when using [email protected] (also tested with version 15.4).
I then changed writeFileListToStream to wait for out.writableNeedDrain to become false. Now electron-forge package finishes when using [email protected], but this could probably be solved in a better way..
+ function sleep(ms) {
+ return new Promise((resolve, reject) => setTimeout(resolve, ms));
+ }
const writeFileListToStream = async function (dest, filesystem, out, list, metadata) {
for (const file of list) {
+ while (out.writableNeedDrain) {
+ await sleep(10);
+ }
if (file.unpack) { // the file should not be packed into archive
const filename = path.relative(filesystem.src, file.filename)
await copyFile(`${dest}.unpacked`, filesystem.src, filename)
} else {
await streamTransformedFile(file.filename, out, metadata[file.filename].transformed)
}
}
return out.end()
}