@tailwindcss/postcss: type error when trying to use with latest postcss
envgap__tailwindlabs__tailwindcss-20288
01 / FAILURE SIGNATURE
As reported upstream
Trying to use `@tailwindcss/postcss` with latest `postcss@8.5.16` version results in the following type error:
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
c8b081d96376871acb0157923e894b7a929cad5b- Manifest
package.json- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
tailwindlabs/tailwindcss #20288 · read the original issue
**What version of Tailwind CSS are you using?**
v4.3.1
**What build tool (or framework if it abstracts the build tool) are you using?**
postcss@8.5.16
**What version of Node.js are you using?**
v24.18.0
**What browser are you using?**
Irrelevant
**What operating system are you using?**
Fedora 44, but issue occurs anywhere
**Reproduction Steps**
```
mkdir tailwindcss-postcss-type-issue
cd tailwindcss-postcss-type-issue
npm init -y
npm pkg set type=module
npm i postcss typescript -D
npx tsc --init
npm i @tailwindcss/postcss -D
echo "import tailwindPostcss from '@tailwindcss/postcss'; import postcss from 'postcss'; postcss([tailwindPostcss()]);" > main.ts
npx tsc --noEmit
```
**Describe your issue**
Trying to use `@tailwindcss/postcss` with latest `postcss@8.5.16` version results in the following type error:
```
error TS2769: No overload matches this call.
Overload 1 of 2, '(plugins?: readonly AcceptedPlugin[] | undefined): Processor_', gave the following error.
Type 'Processor_ | Plugin' is not assignable to type 'AcceptedPlugin'.
...
```
This happens because `@tailwindcss/postcss'` pins postcss to v8.5.15, whose types are not forward compatible with v8.5.16.
This can be worked around when using npm by forcing newer postcss to get installed:
```jsonc
// package.json
{
// ...
"overrides": {
"@tailwindcss/postcss": {
"postcss": "^8.5.16"
}
}
}
```
Possible solutions:
- bump pinned postcss dependency to 8.5.16 (may require future bumps for future versions)
- use a caret for version range, as postcss respects semver
IMO caret is preferred, but this is at your discretion.04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]