From ec6453d1b2e93439595aceb6454448a96668a00d Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 22 Mar 2021 17:39:03 -0700 Subject: [PATCH] fix: installer compilation (#5908) For some reason typescript can't find electron types when using nested tsconfig - workaround the bug. Drive-by: surface installer compilation problems. --- install-from-github.js | 5 ++++- src/utils/utils.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/install-from-github.js b/install-from-github.js index 36a4dc46556bf..684aa45918216 100644 --- a/install-from-github.js +++ b/install-from-github.js @@ -21,8 +21,11 @@ const {execSync} = require('child_process'); console.log(`Rebuilding installer...`); try { - execSync('npm run tsc-installer'); + execSync('npm run tsc-installer', { + stdio: ['inherit', 'inherit', 'inherit'], + }); } catch (e) { + process.exit(1); } console.log(`Downloading browsers...`); diff --git a/src/utils/utils.ts b/src/utils/utils.ts index f97a5556c904d..0d7728b499724 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -27,7 +27,7 @@ export function makeWaitForNextTask() { // As of Mar 2021, Electorn v12 doesn't create new task with `setImmediate` despite // using Node 14 internally, so we fallback to `setTimeout(0)` instead. // @see https://github.com/electron/electron/issues/28261 - if (process.versions.electron) + if ((process.versions as any).electron) return (callback: () => void) => setTimeout(callback, 0); if (parseInt(process.versions.node, 10) >= 11) return setImmediate;