Cant configure Tailwind with DaisyUI using Deno inside of Docker | Error: Cannot find module daisyui
I'm literally pulling my hair right now because i can't figure out why is it not working in my case.
I got tailwind to work but i can't figure out why the DaisyUI can't be found.
Im using docker for local development and here is my config related to deno.
deno.json
tailwind.package.js
Error message from container logs
I would really appreciate any help as I'm pretty close to giving up..
10 Replies
I guess that tailwind tries to look into
node_modules
folder to resolve daisyui
but it doesn't find it because deno does not use the node_modules
dir
Try add this to your deno.json
config:
I feel like something like this should be mentioned somewhere in the documentation. It stated to work after this but the amount of time i spent on searching for solution..
Thank you!
You are most welcomed! The issue is that it's very hard to account for the very wide and often bizarre behavior of the node ecosystem and all the issues you will encounter with Deno will highlight what a mess it is!
Thans for this, but is this good practice?
This is a legit and the official way to have compatibility with node stuff, it’s not magic it just downloads the stuff from npm and saves it there, you would get the same result if you opted in vendoring (ie save the deps in your repo so you can upload it in your deploys. It would create a node_modules dir but also a vendor dir too for non-npm des) so really nothing to worry about
This is great info, and will help me in the future. Thanks for this.
works fine but it causes this error for me when
Instead of
import "typed-htmx"
try import type {} from "typed-htmx"
still got this
Iknow it sounds unusual but did you try to restart the deno server language?