Skip to content
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

TailwindCSS is using stderr to log the messages "Rebuilding..." and "Done in [x]ms" #13656

Open
gc-victor opened this issue May 8, 2024 · 2 comments

Comments

@gc-victor
Copy link

What version of Tailwind CSS are you using?

3.4.3 & next

Describe your issue

I'm working on a library that executes commands, prints errors on red when there is a stderr, and omits the stdout in case is not used the flag --verbose. TailwindCSS is using stderr to log the messages "Rebuilding..." and "Done in [x]ms", so it is causing a miss communication.

In the version 3.4.3:

Looks like this line is the Rebuilding...:

console.error('Rebuilding...')

Looks like this line is the Done in:

console.error('Done in', (end - start) / BigInt(1e6) + 'ms.')

In both cases there is a previous console.error() too.

In the next version:

Case 1:

eprintln(`Done in ${formatDuration(end - start)}`)

Case 2:

eprintln(`Done in ${formatDuration(end - start)}`)

@toothbrush7777777
Copy link

Note that printing status updates and other diagnostic information to stderr is a common practice endorsed by POSIX, so your library will not work properly with many command line applications. The stderr stream is also not buffered, so that means updates are shown immediately, as required for status updates. See https://unix.stackexchange.com/a/331808 for more details.

@gc-victor
Copy link
Author

I've addressed this issue by omitting those strings in my program, so it's no longer a problem. However, I believe there's a potential for improvement in how TailwindCSS handles this.

Are they relevant diagnostic information? I don't think so. "Rebuilding..." is shown when the user executes the command, and it has been removed in the next version. "Done in [x]ms" isn't accurate, and you can use time instead.

I do think that it could make sense when the --watch flag is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants