What version of Tailwind CSS are you using?
4.0.0
What build tool (or framework if it abstracts the build tool) are you using?
typescript: 5.7.2
What version of Node.js are you using?
20.14.0
What operating system are you using?
macOS 15.2
Reproduction URL
https://github.com/cyberalien/tailwind-plugin-bug
Describe your issue
Reproduction includes a very basic plugin:
import plugin from 'tailwindcss/plugin';
const exportedPlugin = plugin(() => {
return ({ matchComponents }) => {
matchComponents({
test: (content: string) => {
return {
color: content,
};
},
});
};
});
export default exportedPlugin;
On line 3 TypeScript throws the following error:
src/plugin.ts:3:7 - error TS2742: The inferred type of 'exportedPlugin' cannot be named without a reference to '../node_modules/tailwindcss/dist/types-BTRmm49E.mjs'. This is likely not portable. A type annotation is necessary.
3 const exportedPlugin = plugin(() => {
~~~~~~~~~~~~~~
Building it using tsc -b.
Removed all unnecessary dependencies and packages to show smallest possible reproduction.
What version of Tailwind CSS are you using?
4.0.0
What build tool (or framework if it abstracts the build tool) are you using?
typescript: 5.7.2
What version of Node.js are you using?
20.14.0
What operating system are you using?
macOS 15.2
Reproduction URL
https://github.com/cyberalien/tailwind-plugin-bug
Describe your issue
Reproduction includes a very basic plugin:
On line 3 TypeScript throws the following error:
Building it using
tsc -b.Removed all unnecessary dependencies and packages to show smallest possible reproduction.