From ec7624c3ca41c1b650e3a4b326e04588d2a736b4 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 22 Mar 2021 14:12:33 -0700 Subject: [PATCH 1/2] fix: installer compilation 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..98e9b5c22cbc8 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 ('electron' in process.versions) return (callback: () => void) => setTimeout(callback, 0); if (parseInt(process.versions.node, 10) >= 11) return setImmediate; From a21b3ae6b2bdaaa8fbbfd6ad198ebf20ac9b7e6c Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 22 Mar 2021 16:50:36 -0700 Subject: [PATCH 2/2] dgozman fix --- src/utils/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 98e9b5c22cbc8..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 ('electron' in process.versions) + if ((process.versions as any).electron) return (callback: () => void) => setTimeout(callback, 0); if (parseInt(process.versions.node, 10) >= 11) return setImmediate;