From d20def5c71609ad97ea783716c53070235f398cc Mon Sep 17 00:00:00 2001 From: Githoniel Date: Fri, 24 Sep 2021 19:46:09 +0800 Subject: [PATCH] fix: display file name for warnings/errors in overlay (#3867) --- client-src/overlay.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client-src/overlay.js b/client-src/overlay.js index 818c3e4d0b..609fb0a314 100644 --- a/client-src/overlay.js +++ b/client-src/overlay.js @@ -130,8 +130,9 @@ function show(messages, type) { messages.forEach((message) => { const entryElement = document.createElement("div"); const typeElement = document.createElement("span"); - - typeElement.innerText = type === "warnings" ? "Warning:" : "Error:"; + // ts-loader will output `error.file` for error file path, not in message + typeElement.innerText = + (type === "warnings" ? "Warning:" : "Error:") + (message.file || ""); typeElement.style.color = `#${colors.red}`; // Make it look similar to our terminal.