-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Cannot build plugin: types in tailwindcss/plugin
are broken
#15844
Comments
Changed reproduction URL to a smaller reproduction without monorepo setup. |
Think this is a TS problem (feature?) rather than tailwind, see possible workarounds: microsoft/TypeScript#47663 (comment) Specifically, this seems to work: import plugin from 'tailwindcss/plugin';
-const exportedPlugin = plugin(() => {
+const exportedPlugin: ReturnType<typeof plugin> = plugin(() => {
return ({ matchComponents }) => {
matchComponents({
test: (content: string) => {
return {
color: content,
};
},
});
};
});
export default exportedPlugin;
|
Proper solution is to export types |
Fixed in #15869 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: