Skip to content
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

DaisyUI can't find type module #1366

Closed
Senbonzakura1234 opened this issue Nov 18, 2022 Discussed in #819 · 6 comments
Closed

DaisyUI can't find type module #1366

Senbonzakura1234 opened this issue Nov 18, 2022 Discussed in #819 · 6 comments

Comments

@Senbonzakura1234
Copy link

Discussed in #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
@yajatvishwak
Copy link

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.

@VictorGlindasPaf
Copy link

@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.

@aneiosi
Copy link

aneiosi commented Dec 1, 2022

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

@Senbonzakura1234
Copy link
Author

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?

@soorria
Copy link
Contributor

soorria commented Dec 29, 2022

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.

@HugoRamonPereira
Copy link

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.

Great, I am having this issue
Screenshot 2022-12-30 at 12 19 30

soorria added a commit to soorria/daisyui that referenced this issue Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants