modd icon indicating copy to clipboard operation
modd copied to clipboard

`daemon: tailwind --watch` exits and restarts in a loop

Open marcuswhybrow opened this issue 2 years ago • 10 comments

modd.conf

tailwind.config.js {
  daemon: tailwind --watch --output ./build/tailwind.css
}

Output of running modd

11:16:21: daemon: tailwind --watch --output ./build/tailwind.css

Rebuilding...
exited: exit status 0
>> restart backoff... 1000ms
>> starting...

Rebuilding...
exited: exit status 0
>> restart backoff... 2000ms

Which continues forever.

Expected output:

Rebuilding...

Done in 977ms.

marcuswhybrow avatar Nov 28 '23 11:11 marcuswhybrow

Still an issue with tailwind v3.4.1 and modd v0.8

marcuswhybrow avatar Apr 09 '24 23:04 marcuswhybrow

Same with modd master? the only other things i can think of is the either the env or stdin/stdout/stderr is different. To look at env maybe add a env ; ... before and see if you see something fishy, for stdin/stdout/stderr maybe do tailwind --watch --output ./build/tailwind.css 2>&1 < /dev/null | cat in an interactive shell to force stderr/stdout to a non-tty and stdin reading from null device (seems to be what will end up happening).

wader avatar Apr 10 '24 07:04 wader

Try this daemon: tailwind --watch --output ./build/tailwind.css < /dev/stdin but i'm not sure hows stdin that will be, i guess it will be modd's that gets inherited down

wader avatar Apr 10 '24 08:04 wader

Same with modd master?

If I have time I'll look into the master build.

Try this daemon: tailwind --watch --output ./build/tailwind.css < /dev/stdin

Issue persists.

marcuswhybrow avatar Apr 10 '24 12:04 marcuswhybrow

Now when i think about it stdin will probably be /dev/null also, maybe something like sleep 999999 | tailwind ... could make tailwind have a stdin to block on and be happy, i suspect it exits when stdin ends

wader avatar Apr 10 '24 12:04 wader

Wow, that did it! Great thinking, I had no idea stdin was both needed, and didn't exist.

marcuswhybrow avatar Apr 10 '24 13:04 marcuswhybrow

🥳 do you know if other modd-like tools have the same issue with tailwind? not really sure what "foregrounded" tools should expect from stdin hmm

wader avatar Apr 10 '24 16:04 wader

Sorry, only used tailwind with modd, (inside Nix develop).

marcuswhybrow avatar Apr 11 '24 22:04 marcuswhybrow