Content changes not detected in SvelteKit when using globs on Windows
See original GitHub issueWhat version of Tailwind CSS are you using? v3.0.23
What build tool (or framework if it abstracts the build tool) are you using? “postcss”: “^8.4.6”,
What version of Node.js are you using? node 16.13.0 and also tried it with 14
What browser are you using? Firefox, also tried on Microsoft Edge
What operating system are you using? Windows
Reproduction URL https://github.com/saym97/portal-exp this is base sveltekit project with Tailwind 3.0 . if you run ‘npm run dev’ the correct style classes will be applied to tag classes in routes/index.svelte but try changing the bg-color to some other color, it won’t change unless you restart the server.
Describe your issue
I wanted to update my current project to Tailwind 3.0 . I am using Sveltekit for my project. I followed the Tailwind Labs youtube guide to update. It updated successfully (because I could use shadow-color class after that). but every time I make changes to class of an element it just doesn’t update the style. It doesn’t generate the newly added class. I have to ‘npm run dev’ every time I make changes. I also tried adding the ‘watch:css’ with ‘npm run dev’ thinking may be tailwind is not tracking changes unless I explicitly run --watch alongside ‘run dev’ but no luck.
**But I did found out that if I run both the --watch and dev command to start server, it tells me that my Content field in tailwind config.cjs is empty or missing but it’s not! if there was something wrong with content field then it wouldn’t generate classes at all even after restarting the server . **
module.exports = { content: ['./src/**/*.{html,js,svelte,ts}'], theme: { extend: {}, }, plugins: [], }
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:18 (2 by maintainers)
If you are using WSL you can configure Vite internally to use polling and it should fix any issues:
I have edited the description of my issue and included the reproduction repo. I hope this explain the problem . Thank you !!