Skip to content

Commit 4ccc0fa

Browse files
Make sure errors are always displayed when watching for changes (#9810)
* Make sure errors are always displayed when watching for changes * Update changelog
1 parent 1482c75 commit 4ccc0fa

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111

1212
- Fix watching of files on Linux when renames are involved ([#9796](https://github.com/tailwindlabs/tailwindcss/pull/9796))
13+
- Make sure errors are always displayed when watching for changes ([#9810](https://github.com/tailwindlabs/tailwindcss/pull/9810))
1314

1415
## [3.2.3] - 2022-11-09
1516

src/cli/build/plugin.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,23 @@ export async function createProcessor(args, cliConfigPath) {
364364
console.error()
365365
console.error('Done in', (end - start) / BigInt(1e6) + 'ms.')
366366
})
367+
.then(
368+
() => {},
369+
(err) => {
370+
// TODO: If an initial build fails we can't easily pick up any PostCSS dependencies
371+
// that were collected before the error occurred
372+
// The result is not stored on the error so we have to store it externally
373+
// and pull the messages off of it here somehow
374+
375+
// This results in a less than ideal DX because the watcher will not pick up
376+
// changes to imported CSS if one of them caused an error during the initial build
377+
// If you fix it and then save the main CSS file so there's no error
378+
// The watcher will start watching the imported CSS files and will be
379+
// resilient to future errors.
380+
381+
console.error(err)
382+
}
383+
)
367384
}
368385

369386
/**

0 commit comments

Comments
 (0)