diff --git a/desktop/flipper-server/src/index.tsx b/desktop/flipper-server/src/index.tsx index df5db7f9d..ef87bee3c 100644 --- a/desktop/flipper-server/src/index.tsx +++ b/desktop/flipper-server/src/index.tsx @@ -20,6 +20,7 @@ import open from 'open'; import os from 'os'; import {initCompanionEnv} from 'flipper-server-companion'; import { + checkPortInUse, checkServerRunning, compareServerVersion, getEnvironmentInfo, @@ -167,6 +168,11 @@ async function start() { } else { launchAndFinish = true; } + } else { + if (await checkPortInUse(argv.port)) { + console.info('[flipper-server] Checking if port is in use'); + await shutdownRunningInstance(argv.port); + } } const t3 = performance.now();