From 83f449f3d0c85437400111cd74a4a9afbc28e9a1 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 11 Nov 2022 10:01:19 -0500 Subject: [PATCH 1/2] Make sure errors are always displayed when watching for changes --- src/cli/build/plugin.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/cli/build/plugin.js b/src/cli/build/plugin.js index 8d21516ef3ff..6b61c723eeff 100644 --- a/src/cli/build/plugin.js +++ b/src/cli/build/plugin.js @@ -364,6 +364,23 @@ export async function createProcessor(args, cliConfigPath) { console.error() console.error('Done in', (end - start) / BigInt(1e6) + 'ms.') }) + .then( + () => {}, + (err) => { + // TODO: If an initial build fails we can't easily pick up any PostCSS dependencies + // that were collected before the error occurred + // The result is not stored on the error so we have to store it externally + // and pull the messages off of it here somehow + + // This results in a less than ideal DX because the watcher will not pick up + // changes to imported CSS if one of them caused an error during the initial build + // If you fix it and then save the main CSS file so there's no error + // The watcher will start watching the imported CSS files and will be + // resilient to future errors. + + console.error(err) + } + ) } /** From 4a050f77abc36bf95653a99804c54d9025bd31d3 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 11 Nov 2022 10:10:43 -0500 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2caf67580ad..cb7712480e0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix watching of files on Linux when renames are involved ([#9796](https://github.com/tailwindlabs/tailwindcss/pull/9796)) +- Make sure errors are always displayed when watching for changes ([#9810](https://github.com/tailwindlabs/tailwindcss/pull/9810)) ## [3.2.3] - 2022-11-09