Skip to content

Commit 0b0862b

Browse files
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
1 parent e9ca7ab commit 0b0862b

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

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

3031
### Added
3132

integrations/rollup-sass/tests/integration.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ describe('watcher', () => {
295295
)
296296
await runningProcess.onStderr(ready)
297297

298+
await new Promise((resolve) => setTimeout(resolve, 5000))
299+
298300
expect(await readOutputFile('index.css')).toIncludeCss(
299301
css`
300302
.btn {
@@ -334,5 +336,5 @@ describe('watcher', () => {
334336
)
335337

336338
return runningProcess.stop()
337-
})
339+
}, 30000)
338340
})

src/cli/build/watching.js

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

0 commit comments

Comments
 (0)