-
Notifications
You must be signed in to change notification settings - Fork 226
In React: Could not find a declaration file for module '@tailwindcss/forms' #18
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
Comments
Because I was following along the Workcation tutorial on YouTube, I was attempting to use Forms as Custom-Forms. Perhaps there could be an onboarding for those like me who were in the Custom-Forms mindset. I solved the issue above by adding a Also, this post from Tailwind's blog would be helpful to understand the context of this project: https://blog.tailwindcss.com/tailwindcss-v2#utility-friendly-form-styles Hope it helps someone new to Tailwind like myself! 🙂 |
Your wish has come true, it just helped me a lot. Had exact same issue, started with custom-forms and everything and found your other post lol This happened to me in a Vue environment so not specific to react Just wondering if anyone knows, this error went away following the instruction @instanetk but my tailwind-intellisense in vscode still does not recommend any form classes, why is that? I assume it is because that intellisense is not up to date with the new forms plugin? also with forms installed on my server it was rendering the forms classes added without trouble, why is this declaration file needed in local dev env and not on the server to work? thanks! |
Thank you @instanetk I was trying to import |
how to add global.d.ts file to react with plain javascript? |
Followed the install instructions
npm install @tailwindcss/forms
Then required the plugin in tailwind.config.js
// tailwind.config.js
module.exports = { // ... plugins: [ require('@tailwindcss/forms'), ] }
But when mousing over the @tailwindcss/forms the following message is displayed:
module "/Users/user/Desktop/Index/git/project/react/node_modules/@tailwindcss/forms/src/index" Could not find a declaration file for module '@tailwindcss/forms'. '/Users/user/Desktop/Index/git/project/react/node_modules/@tailwindcss/forms/src/index.js' implicitly has an 'any' type. Try
npm install @types/tailwindcss__formsif it exists or add a new declaration (.d.ts) file containing
declare module '@tailwindcss/forms';ts(7016)
So far no joy...
PS: I was previously using
custom-forms
with the same error. Opened an issue with the same content under that project. Sorry if it is cross posting but I am experiencing the same issue with both packages...The text was updated successfully, but these errors were encountered: