timonweb / django-tailwind

Django + Tailwind CSS = šŸ’š
https://django-tailwind.readthedocs.io
MIT License
1.44k stars 88 forks source link

Not rebuilding automatically when new classes are added to templates #190

Open O-39889 opened 9 months ago

O-39889 commented 9 months ago

That's pretty much it. I installed and set it up all according to instructions on the website, also used the browser reload package, was working on Windows. When I run python manage.py tailwind start, it launches just fine and rebuilds everything. However, after that, when I edit and save the templates, nothing happens, and it doesn't trigger the rebuild process at all. The only workaround I have found besides just relaunching that program each time is just to save the tailwind.config.js file, which will make it rebuild just fine as well, but that of course is really just a hack and kind of not what I intended (and probably not what the developer intended either).

Node.js version: 18.16.0 npm version: 9.5.1

I first thought the problem might be with the content paths in my configs, but since it actually does find new utility classes and builds them correctly, I can only assume the problem might be somewhere else (by the way, the default paths work just fine when detecting templates on launch in my project). However, the docs for this package don't really mention any other setup being required for the JIT mode to work ā€” in fact, isn't JIT mode integrated in new versions anyway?

vidyanand commented 9 months ago

I am running into the same issue as well. django-tailwind: 3.6.0 Node.js version: 20.9.0 NPM Version: 10.1.0

Zenthae commented 8 months ago

Same issue here, though I'm in a devcontainer. What i'm doing at the moment is generating every classes for dev with the following config

    safelist: [
        {
            pattern: /./,
        }
    ],
Zenthae commented 8 months ago

So, after tearing all my hairs off, I found a solution, you must set this env var CHOKIDAR_USEPOLLING=1 for it to work. The issue is coming from the file watcher used by Tailwindcss, chokidar. Here are the relevant issues: https://github.com/paulmillr/chokidar/issues/1051 https://github.com/privatenumber/tsx/issues/266#issuecomment-1636675078 https://github.com/paulmillr/chokidar#performance

alexander-schillemans commented 7 months ago

So, after tearing all my hairs off, I found a solution, you must set this env var CHOKIDAR_USEPOLLING=1 for it to work. The issue is coming from the file watcher used by Tailwindcss, chokidar. Here are the relevant issues: paulmillr/chokidar#1051 privatenumber/tsx#266 (comment) https://github.com/paulmillr/chokidar#performance

Thanks, that fixed it for me!

faustom721 commented 1 month ago

@Zenthae thanks a lot man, you saved my life here. I've been trying to make this work for like a week today. Works perfectly with that env var on docker now, thank you!