-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[v4] Angular compilation errors in Docker are preventing TailwindCSS from working. #16364
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
Comments
Seeing this too but not on every build... |
I have the same issue, any idea on how to fix this, or what causes this issue? |
I’m experiencing the same issue with Angular 19 and Tailwind v4. When running Tailwind inside Docker, the generated CSS file contains some malformed classes, including one with a As a temporary workaround, I’m using the following commands before RUN npx @tailwindcss/cli -i src/styles/tailwind.css -o src/styles/tailwind.css
RUN sed -i 's/uri: \/hoge\/\*/uri: ""/g' src/styles/tailwind.css
RUN npm run build Has anyone found a better solution? |
Same issue here. I did find my own workaround, maybe this can be of use for others struggling with this while there is no real solution. ...
COPY package*.json ./
RUN npm ci
# temporary workaround to prevent parsing of unwanted files by tailwind
RUN find node_modules -path '*/needle/test/files/*' -delete
COPY . .
RUN npm run build
... I believe this to be a bug in tailwind, but I didn't go code-diving to be certain of this. What I found out about this issue: |
Just ran into this as well. @hironized your workaround worked for me. Thanks. |
Same problem here, for me the problem was in the same file @hironized mentioned and a few |
Hey folks! Sorry for the long wait here but I finally got the chance to look into the repo. The way automatic content discovery works is described in our docs here: https://tailwindcss.com/docs/detecting-classes-in-source-files#which-files-are-scanned. The reason why the Docker build contains some utilities that the local development build does not have is that inside the container, not Thankfully, I was able to fix the repro in one line by ensuring the diff --git a/projects/webapp/Dockerfile b/projects/webapp/Dockerfile
index 48c4f8d..9bdda92 100644
--- a/projects/webapp/Dockerfile
+++ b/projects/webapp/Dockerfile
@@ -12,6 +12,7 @@ COPY webclient/.postcssrc.json ./
COPY webclient/angular.json .
COPY webclient/tsconfig.json .
COPY webclient/projects/webapp ./projects/webapp
+COPY webclient/.gitignore .
CMD if [ "${ENVIRONMENT}" = "development" ]; then npm run start:webapp; else ng build; fi (Note I actually had to change the file and not include the |
Had the same issue with deployment to vercel, so adding .gitignore [to the allow-lists] (https://vercel.com/docs/deployments/vercel-ignore#allowlist) fixed the issue
|
Well, I'm using The error after the fix from earlier now results into:
I'm also not really sure what to do with the sources. Should I just include my own css files, or will it need primeng and other plugins/dependencies as well? Or should i not include my own css files? Its all a bit vague and I don't really understand why the pipeline works different than what I do locally |
What version of Tailwind CSS are you using?
TailwindCSS v4.0
What build tool (or framework if it abstracts the build tool) are you using?
What version of Node.js are you using?
Node:22-alpine (Docker image)
What browser are you using?
Chrome
What operating system are you using?
Windows 11 Pro 64-bit
Reproduction URL
https://github.com/johnadrian63/tailwind-docker
Describe your issue
I have an Angular application that uses TailwindCSS v4. It works perfectly on my local machine, but when I run it inside a Docker container, I encounter compilation errors that prevent TailwindCSS from functioning properly.
Describe the problem you're seeing, any important steps to reproduce and what behavior you expect instead.
Here is the compilation errors that I encountered:
Steps to reproduce:
docker build -t docker-test5-webclient-app -f ${PWD}/webclient/projects/webapp/Dockerfile .
docker run --name docker-test5-webclient-app --env-file ./webclient/config/.env -d -p 8080:4200 -v ${PWD}/webclient/projects/webapp:/app/projects/webapp docker-test5-webclient-app
Here is the content of my Dockerfile:
The text was updated successfully, but these errors were encountered: