From 5f247f7962bbdb9d1bcb58ae46a0b2baef8306d6 Mon Sep 17 00:00:00 2001 From: konnorrogers Date: Tue, 29 Aug 2023 17:03:10 -0400 Subject: [PATCH 1/3] show errors in dev server --- scripts/build.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/build.js b/scripts/build.js index e46f4ef9b0..fa29ad5e90 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -34,6 +34,9 @@ const shoelaceVersion = JSON.stringify(packageData.version.toString()); async function buildTheDocs(watch = false) { return new Promise(async (resolve, reject) => { const afterSignal = '[eleventy.after]'; + + // Totally non-scientific way to handle errors. Perhaps its just better to resolve on stderr? :shrug: + const errorSignal = 'Original error stack trace:' const args = ['@11ty/eleventy', '--quiet']; const output = []; @@ -65,6 +68,14 @@ async function buildTheDocs(watch = false) { resolve({ child, output }); } }); + + child.stderr.on('data', data => { + if (data.includes(errorSignal)) { + // This closes the dev server, not sure if thats what we want? + reject(child); + } + }); + } else { child.on('close', () => { resolve({ child, output }); From 3a5cddc244a0af3430850ea53b1a8c098f357aa7 Mon Sep 17 00:00:00 2001 From: konnorrogers Date: Tue, 29 Aug 2023 17:08:18 -0400 Subject: [PATCH 2/3] fix build --- scripts/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.js b/scripts/build.js index fa29ad5e90..f3764dc903 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -72,7 +72,7 @@ async function buildTheDocs(watch = false) { child.stderr.on('data', data => { if (data.includes(errorSignal)) { // This closes the dev server, not sure if thats what we want? - reject(child); + reject(output); } }); From 89d5f31765220c1be86ae422c2d928e3218082c1 Mon Sep 17 00:00:00 2001 From: konnorrogers Date: Wed, 30 Aug 2023 09:14:43 -0400 Subject: [PATCH 3/3] prettier --- scripts/build.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index f3764dc903..0249155720 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -36,7 +36,7 @@ async function buildTheDocs(watch = false) { const afterSignal = '[eleventy.after]'; // Totally non-scientific way to handle errors. Perhaps its just better to resolve on stderr? :shrug: - const errorSignal = 'Original error stack trace:' + const errorSignal = 'Original error stack trace:'; const args = ['@11ty/eleventy', '--quiet']; const output = []; @@ -75,7 +75,6 @@ async function buildTheDocs(watch = false) { reject(output); } }); - } else { child.on('close', () => { resolve({ child, output });