Fix crash when watching renamed files on FreeBSD (#12193)

* Fix file watching bug when renaming files on FreeBSD

* Update changelog

* Add delay to test

* Bump delay

* Update test
This commit is contained in:
Jordan Pittman 2023-10-17 09:50:35 -04:00 • committed by GitHub
parent e9ca7ab453
commit 0b0862b20c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View file

@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve RegEx parser, reduce possibilities as the key for arbitrary properties ([#12121](https://github.com/tailwindlabs/tailwindcss/pull/12121))
- Fix sorting of utilities that share multiple candidates ([#12173](https://github.com/tailwindlabs/tailwindcss/pull/12173))
- Ensure variants with arbitrary values and a modifier are correctly matched in the RegEx based parser ([#12179](https://github.com/tailwindlabs/tailwindcss/pull/12179))
- Fix crash when watching renamed files on FreeBSD ([#12193](https://github.com/tailwindlabs/tailwindcss/pull/12193))
### Added

View file

@ -295,6 +295,8 @@ describe('watcher', () => {
)
await runningProcess.onStderr(ready)
await new Promise((resolve) => setTimeout(resolve, 5000))
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.btn {
@ -334,5 +336,5 @@ describe('watcher', () => {
)
return runningProcess.stop()
})
}, 30000)
})

View file

@ -164,7 +164,7 @@ export function createWatcher(args, { state, rebuild }) {
// This is very likely a chokidar bug but it's one we need to work around
// We treat this as a change event and rebuild the CSS
watcher.on('raw', (evt, filePath, meta) => {
if (evt !== 'rename') {
if (evt !== 'rename' || filePath === null) {
return
}