Skip to content

All @tailwindcss/cli commands handing forever docker builds #17781

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

Open
ghmeier opened this issue Apr 24, 2025 · 2 comments
Open

All @tailwindcss/cli commands handing forever docker builds #17781

ghmeier opened this issue Apr 24, 2025 · 2 comments

Comments

@ghmeier
Copy link

ghmeier commented Apr 24, 2025

What version of Tailwind CSS are you using?

v4.1.4

What build tool (or framework if it abstracts the build tool) are you using?

Docker

What version of Node.js are you using?

v22.15.0

What browser are you using?

N/A

What operating system are you using?

darwin/arm64 and linux/arm64

Reproduction URL

https://github.com/ghmeier/tailwind-repro

The docker build hangs indefinitely when running:

docker build . 

Describe your issue

When running any tailwind while building docker containers for any architecture (the issue is reproducible when running docker buildx build --platform linux/amd64) any command that utilizes tailwind cli hangs. The repro case provided above is a minimal example where just running npx @tailwindcss/cli -v hangs indefinitely, but this also happens when building css using the cli directly or via webpack. Running the same command on my M1 Macbook pro resolves correctly.

Including DEBUG=1 does not resolve the issue, the command doesn't output anything.

The repro cases uses node:22.15.0-alpine3.20 but I've yet to find a base image that solves the issue.

I've looked through the couple of other issues and this looks most similar to #15730, but not quite the same.

@ghmeier
Copy link
Author

ghmeier commented Apr 24, 2025

Ok, I'm working to narrow down the version this was introduced in and when I use 4.0.17 (npm i @tailwindcss/cli@4.0.17 tailwindcss@4.0.17), the fails with the following error:

 => ERROR [4/4] RUN npx @tailwindcss/cli -v                                                                                                                                                                      1.8s
------                                                                                                                                                                                                                
 > [4/4] RUN npx @tailwindcss/cli -v:                                                                                                                                                                                 
#8 1.199                                                                                                                                                                                                              
#8 1.199 thread '<unnamed>' panicked at crates/oxide/src/scanner/allowed_paths.rs:115:10:                                                                                                                             
#8 1.199 called `Option::unwrap()` on a `None` value                                                                                                                                                                  
#8 1.199 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#8 1.208 fatal runtime error: failed to initiate panic, error 2532534672
#8 1.757 npm error path /
#8 1.758 npm error command failed
#8 1.758 npm error signal SIGABRT
#8 1.758 npm error command sh -c tailwindcss -v
#8 1.760 npm error A complete log of this run can be found in: /root/.npm/_logs/2025-04-24T19_56_00_902Z-debug-0.log
------
executor failed running [/bin/sh -c npx @tailwindcss/cli -v]: exit code: 1

Then using 4.1.0, it hangs forever.

@skeggse
Copy link

skeggse commented Apr 25, 2025

Got a little curious, tried to repro:

$ podman run -it --entrypoint npx node:22.15.0-alpine3.20 -y @tailwindcss/cli@4.0.17
≈ tailwindcss v4.0.17

Usage:
  tailwindcss [--input input.css] [--output output.css] [--watch] [options…]

Options:
  -i, --input ··········· Input file
  -o, --output ·········· Output file [default: `-`]
  -w, --watch ··········· Watch for changes and rebuild as needed
  -m, --minify ·········· Optimize and minify the output
      --optimize ········ Optimize the output without minifying
      --cwd ············· The current working directory [default: `.`]
  -h, --help ············ Display usage information
npm notice
npm notice New major version of npm available! 10.9.2 -> 11.3.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
npm notice To update run: npm install -g npm@11.3.0
npm notice



$ podman run -it --entrypoint npx node:22.15.0-alpine3.20 -y @tailwindcss/cli@4.1.0
≈ tailwindcss v4.1.0

Usage:
  tailwindcss [--input input.css] [--output output.css] [--watch] [options…]

Options:
  -i, --input ··········· Input file
  -o, --output ·········· Output file [default: `-`]
  -w, --watch ··········· Watch for changes and rebuild as needed
  -m, --minify ·········· Optimize and minify the output
      --optimize ········ Optimize the output without minifying
      --cwd ············· The current working directory [default: `.`]
  -h, --help ············ Display usage information
npm notice
npm notice New major version of npm available! 10.9.2 -> 11.3.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
npm notice To update run: npm install -g npm@11.3.0
npm notice

I can't imagine this is actually docker-specific, but... seemingly doesn't repro under podman? Or maybe I'm not understanding the repro instructions.

Weirdly, if I try to do -v it gives a cryptic error:

$ podman run -it --entrypoint npx node:22.15.0-alpine3.20 -y @tailwindcss/cli@4.0.17 -v
Error: Can't resolve 'tailwindcss' in '/'

I can repro the build from the repro repo, though. I have a vague recollection that podman build also uses buildx. strace suggests that it gets stuck in an epoll_pwait loop:

epoll_pwait(13, [], 1024, 4753, NULL, 8) = 0
write(16, "\1\0\0\0\0\0\0\0", 8)        = 8
epoll_pwait(13, [{events=EPOLLIN, data={u32=16, u64=16}}], 1024, 0, NULL, 8) = 1
read(16, "\1\0\0\0\0\0\0\0", 1024)      = 8
epoll_pwait(13, [], 1024, 0, NULL, 8)   = 0
epoll_pwait(13, [], 1024, 8100, NULL, 8) = 0
write(16, "\1\0\0\0\0\0\0\0", 8)        = 8
epoll_pwait(13, [{events=EPOLLIN, data={u32=16, u64=16}}], 1024, 0, NULL, 8) = 1
read(16, "\1\0\0\0\0\0\0\0", 1024)      = 8
epoll_pwait(13, [], 1024, 0, NULL, 8)   = 0
epoll_pwait(13, [], 1024, 8099, NULL, 8) = 0
write(16, "\1\0\0\0\0\0\0\0", 8)        = 8
epoll_pwait(13, [{events=EPOLLIN, data={u32=16, u64=16}}], 1024, 0, NULL, 8) = 1
read(16, "\1\0\0\0\0\0\0\0", 1024)      = 8
epoll_pwait(13, [], 1024, 0, NULL, 8)   = 0
epoll_pwait(13, [], 1024, 8099, NULL, 8) = 0
write(16, "\1\0\0\0\0\0\0\0", 8)        = 8
epoll_pwait(13, [{events=EPOLLIN, data={u32=16, u64=16}}], 1024, 0, NULL, 8) = 1
read(16, "\1\0\0\0\0\0\0\0", 1024)      = 8
epoll_pwait(13, [], 1024, 0, NULL, 8)   = 0
epoll_pwait(13,

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