Replies: 3 comments 4 replies
-
You've tried to pass tailwindcss/packages/@tailwindcss-postcss/src/index.ts Lines 50 to 56 in 2941a7b There is no way to pass dynamic content into the PostCSS plugin. It works by scanning the file system. You could workaround this by:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Even reading from file doesn't work:
Output : test.html path: /home/www/jit-tw-v4/test.html
test.html exists: true
test.html content: <div class="bg-blue-500">Hello</div>
Tailwind plugin loaded: true
Node.js version: v22.12.0
Processing with config: {
"content": [
"/home/www/jit-tw-v4/test.html"
],
"theme": {
"extend": {}
},
"corePlugins": {
"preflight": true
},
"debug": true
}
Generated CSS: /*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */
Warning: Expected class (bg-blue-500) not found in output.``` |
Beta Was this translation helpful? Give feedback.
2 replies
-
Maybe related: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
[v4] @tailwindcss/postcss Fails to Generate Utility Classes for In-Memory Content
Describe the bug
When using
@tailwindcss/postcss@4.1.11
with PostCSS to process in-memory content, Tailwind fails to generate utility classes (e.g.,bg-blue-500
). The output only contains the banner (/*! tailwindcss v4.x.x | MIT License | https://tailwindcss.com */
). No errors or warnings are reported. File-based content scanning also fails with the same issue. This does not occur with Tailwind v3.4.14 in the same setup.To Reproduce
test-in-memory.js
:Expected behavior
Generated CSS should include:
Actual behavior
Generated CSS:
/*! tailwindcss v4.0.7 | MIT License | https://tailwindcss.com */
Environment
postcss@8.5.6
@tailwindcss/postcss@4.0.7
(also tested with@tailwindcss/postcss@4.1.11
)@tailwindcss/node@4.0.7
(installed as a dependency)tailwindcss@4.0.7
(installed as a dependency)Additional context
content: ["./test.html"]
with<div class="bg-blue-500">Hello</div>
) produces the same result.@tailwindcss/node@4.0.7
or@tailwindcss/node@4.1.11
) fails due to a missingnode_modules/.bin/tailwindcss
binary.['tailwindcss-postcss-fix-relative-paths', 'tailwindcss']
.Possible Cause
This may be related to compatibility issues with Node.js v22.12.0 or a bug in
@tailwindcss/postcss@4.0.7
and@tailwindcss/postcss@4.1.11
for in-memory content scanning. The issue persists across minimal configurations, indicating a potential regression from v3.Beta Was this translation helpful? Give feedback.
All reactions