Skip to content

@tailwindcss/postcss #16962

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

Closed
VulcanTech-io opened this issue Mar 5, 2025 · 2 comments
Closed

@tailwindcss/postcss #16962

VulcanTech-io opened this issue Mar 5, 2025 · 2 comments

Comments

@VulcanTech-io
Copy link

VulcanTech-io commented Mar 5, 2025

What version of Tailwind CSS are you using?
"postcss": "^8.5.3",
"tailwindcss": "^4.0.9"
"@tailwindcss/postcss": "4.0.0-alpha.13",
"autoprefixer": "^10.4.20",

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

"next": "^15.2.1",
"turbo": "^2.4.4",

What version of Node.js are you using?

For example: v18.19.0

What browser are you using?

firefox

What operating system are you using?

macOS

Reproduction URL
https://github.com/VulcanTech-io/tailwindcss-postcss-plugin-issue
Describe your issue

const config = {
  plugins: {
    "@tailwindcss/postcss": {},
  },
};
export default config;

Adding this plugin breaks support for global imports from node modules when there is a font being imported from them.
for minimal reproduction "fix" comment out the plugin. But then tailwindcss is no longer working.

⨯ ./node_modules/@milkdown/crepe/lib/theme/common/style.css
Error evaluating Node.js code
CssSyntaxError: postcss-import: ~/turbo-test/node_modules/@milkdown/crepe/lib/theme/common/prosemirror.css:1:1: Failed to find '@milkdown/kit/prose/view/style/prosemirror.css'

@VulcanTech-io
Copy link
Author

This might be a duplicate of #16636

@philipp-spiess
Copy link
Member

Hey! We looked into your repro. There is indeed also #16636 an issue but the bug you are seeing is because the @tailwindcss/postcss plugin is on a stone-age version: https://github.com/VulcanTech-io/tailwindcss-postcss-plugin-issue/blob/2f44abb3ba121ce3bcddc7522bd6b2fe0cc27f3c/apps/docs/package.json#L18 If you update that to the latest v4 release it will show the error that #16636 is about. Going to close this issue and we'll continue to investigate #16636 👍

philipp-spiess added a commit that referenced this issue Mar 7, 2025
Fixes #16636 

This PR enables URL rebasing for PostCSS. Furthermore it fixes an issue
where transitive imports rebased against the importer CSS file instead
of the input CSS file. While fixing this we noticed that this is also
broken in Vite right now and that our integration test swallowed that
when testing because it did not import any Tailwind CSS code and thus
was not considered a Tailwind file.

## Test plan

- Added regression integration tests
- Also validated it against the repro of
#16962:
  
<img width="1149" alt="Screenshot 2025-03-05 at 16 41 01"
src="https://github.com/user-attachments/assets/85396659-d3d0-48c0-b1c7-6125ff8e73ac"
/>

---------

Co-authored-by: Robin Malfait <[email protected]>
Co-authored-by: Jordan Pittman <[email protected]>
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