From 8e4ed705855039babfde4c359dc1838cd39df593 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Tue, 17 Oct 2023 09:50:35 -0400 Subject: [PATCH] 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 --- CHANGELOG.md | 1 + integrations/rollup-sass/tests/integration.test.js | 4 +++- src/cli/build/watching.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0de8311056e..d15cc9c1fe0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) ## [3.3.3] - 2023-07-13 diff --git a/integrations/rollup-sass/tests/integration.test.js b/integrations/rollup-sass/tests/integration.test.js index 19a7695659d8..a5189cd6454d 100644 --- a/integrations/rollup-sass/tests/integration.test.js +++ b/integrations/rollup-sass/tests/integration.test.js @@ -352,6 +352,8 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) + await new Promise((resolve) => setTimeout(resolve, 5000)) + expect(await readOutputFile('index.css')).toIncludeCss( css` .btn { @@ -409,5 +411,5 @@ describe('watcher', () => { } return runningProcess.stop() - }) + }, 30000) }) diff --git a/src/cli/build/watching.js b/src/cli/build/watching.js index e69cd9f8598c..b7788726c1cb 100644 --- a/src/cli/build/watching.js +++ b/src/cli/build/watching.js @@ -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 }