daisyui
daisyui copied to clipboard
DaisyUI can't find type module
Discussed in https://github.com/saadeghi/daisyui/discussions/819
Originally posted by huskyjp May 28, 2022
I do have Nextjs & Tailwind codebase and just implemented daisyui by npm i daisyui
.
Then added plugins: [require('daisyui')]
in tailwind.config.js file.
I get a warning error that says like below and I believe typescript currently can not find daisyui type file??
Could not find a declaration file for module 'daisyui'. '/Users/dev//node_modules/daisyui/src/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/daisyui` if it exists or add a new declaration (.d.ts) file containing `declare module 'daisyui';`ts(7016)
Also - when I tried to simply implemet some daisyui component like
<button class="btn">My DaisyUI button</button>
it just shows text without any daisyui design.
I am not sure if the root problem is typescript error but when I start running the app, I get the daisyUI message so I believe the implementation is good but not working correctly for some reasaons.
daisyUI components 2.15.1 https://github.com/saadeghi/daisyui
โ๏ธ Including: base, components, themes[29], utilities
Would love to know following points ๐
- the type error reason
- any possible reason why daisyui component is not working
Try using the repo examples as a boilerplate to start your project. here: https://stackblitz.com/edit/daisyui-nextjs?file=package.json
I'm guessing it has to do with the way you set up your project.
@yajatvishwak
It's not. I'm getting the same issue, and it's due to there existing no type declarations anywhere.
So ideally either the published package should contain type definitions, or they should exist under @types/daisyui
.
having the same issue
the best way to fix it IMHO would be to create a "@types/daisyui" package at https://github.com/definitelytyped/definitelytyped
having the same issue
the best way to fix it IMHO would be to create a "@types/daisyui" package at https://github.com/definitelytyped/definitelytyped
do you know the shape of daisyui export thou?
Hey! I'm happy to take this issue if no one else has started work. I've added types for some (much smaller) Tailwind plugins I've written so should be pretty simple. I'm also planning on adding types for the config so you should get intellisense for the daisyui
field in your tailwind.config.js
.
Hey! I'm happy to take this issue if no one else has started work. I've added types for some (much smaller) Tailwind plugins I've written so should be pretty simple. I'm also planning on adding types for the config so you should get intellisense for the
daisyui
field in yourtailwind.config.js
.
Great, I am having this issue