From 2a839b50c839d7cef1f2c0c98ffc726b5ed6dddc Mon Sep 17 00:00:00 2001 From: Fatme Date: Mon, 25 Feb 2019 15:54:40 +0200 Subject: [PATCH] fix: fix "Cannot read property 'kill' of undefined" error `Cannot read property 'kill' of undefined` is thrown when `ctrl+c` is clicked too early when webpack process is started but still not persisted --- lib/compiler.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/compiler.js b/lib/compiler.js index eeb1515c..0dd35c11 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -173,7 +173,9 @@ function logSnapshotWarningMessage($logger) { function stopWebpackForPlatform(platform) { const webpackProcess = webpackProcesses[platform]; - webpackProcess.kill("SIGINT"); - delete webpackProcesses[platform]; + if (webpackProcess) { + webpackProcess.kill("SIGINT"); + delete webpackProcesses[platform]; + } }