Skip to content

Support for Tailwind 4 @tailwindcss/postcss #746

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
ratsey opened this issue Jan 30, 2025 · 1 comment
Closed

Support for Tailwind 4 @tailwindcss/postcss #746

ratsey opened this issue Jan 30, 2025 · 1 comment

Comments

@ratsey
Copy link

ratsey commented Jan 30, 2025

For which library do you need help?

native-federation

Question

Attempting to migrate a working native federation project with Tailwind 3 to TW4. This includes adding the package @tailwindcss/postcss and configuring it to run with the .postcssrc.json config:

{
  "plugins": {
    "@tailwindcss/postcss": {}
  }
}

When run, this produces errors from the federated build:

X [ERROR] Could not resolve "node:fs"

    node_modules/@tailwindcss/postcss/dist/index.mjs:40:15:
      40 │ import re from "node:fs";
         ╵                ~~~~~~~~~

  The package "node:fs" wasn't found on the file system but is built into node. Are you trying to    
  bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

0 of 1 warning and 1 of 52 errors shown (disable the message limit with --log-limit=0)
 ERR!  Error bundling shared npm package 
 ERR!  Build failed with 52 errors:
 ERR!  node_modules/@tailwindcss/node/dist/index.mjs:8:19: ERROR: Could not resolve "node:module"    
 ERR!  node_modules/@tailwindcss/node/dist/index.mjs:9:36: ERROR: Could not resolve "node:url"       
 ERR!  node_modules/@tailwindcss/node/dist/index.mjs:25:14: ERROR: Could not resolve "node:fs"       
 ERR!  node_modules/@tailwindcss/node/dist/index.mjs:26:15: ERROR: Could not resolve "node:fs/promise

Adding "@tailwindcss/postcss" to the federation.config.js 'skip' array removes the issue but then the postprocessor does not run. I'm logging this as a question rather than a bug since it may just be a misconfiguration on my part?

"@angular-architects/native-federation": "^19.0.7"
"@angular/cli": "^19.1.5"

Node v22.10.0

@manfredsteyer
Copy link
Contributor

Please try moving @tailwindcss/postcss from dependencies into devDependencies in your package.json.

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