Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

--watch not observing changes done by vi when input file and config file are in different directories (but works with --poll mode) #14308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kbr- opened this issue Aug 31, 2024 · 4 comments

Comments

@kbr-
Copy link

kbr- commented Aug 31, 2024

What version of Tailwind CSS are you using?

3.4.10, tailwindcss-linux-x64 binary downloaded for the releases page.

What operating system are you using?

Linux pop-os 6.9.3-76060903-generic #202405300957~1721174657~22.04~abb7c06 SMP PREEMPT_DYNAMIC Wed J x86_64 x86_64 x86_64 GNU/Linux

Reproduction + description

You need two empty files: empty config.js file and empty input.css file; they must be in separate directories. You can execute the following sequence of bash commands to reproduce:

mkdir repro
cd repro
mkdir cfg
touch cfg/config.js
touch input.css
wget https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.10/tailwindcss-linux-x64
chmod +x tailwindcss-linux-x64
./tailwindcss-linux-x64 -c cfg/config.js -i input.css -o output.css -w

Then open the file input.css in vi and save it (:w).

Tailwind will not rebuild the file on save.

The conditions to reproduce the issue are oddly specific:

  • touch input.css causes rebuild
  • opening it with gedit and saving causes rebuild
  • if we add -p (--poll), saving in vi works (causes rebuild):
./tailwindcss-linux-x64 -c cfg/config.js -i input.css -o output.css -w -p
  • if we use config.js from the same directory as input.css, saving in vi works:
touch config.js
./tailwindcss-linux-x64 -c cfg/config.js -i input.css -o output.css -w

Why vi is needed? I'm guessing it's somehow related to the file metadata, perhaps saving in vi is not modifying some file metadata that touch or saving with another editor like gedit does, and -w is observing this metadata. I'd guess there are some other editors which make this possible to reproduce.

But why do the files have to be in different directories? No idea.

@kbr-
Copy link
Author

kbr- commented Aug 31, 2024

Possible cause:
nodejs/node-v0.x-archive#3172 (comment)

:set backupcopy=yes in vi makes the issue go away.

@philipp-spiess
Copy link
Member

Hey! Were you able to update to Tailwind CSS v4 and check if that's still an issue there?

@kbr-
Copy link
Author

kbr- commented Apr 11, 2025

Sorry, I haven't touched frontend since September last year :)

@philipp-spiess
Copy link
Member

@kbr- Haha fair! I'm going to move this to a discussion for now then. 👍

@tailwindlabs tailwindlabs locked and limited conversation to collaborators May 6, 2025
@philipp-spiess philipp-spiess converted this issue into discussion #17893 May 6, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants