-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Content changes not detected in SvelteKit when using globs on Windows #7590
Comments
Hey! Can you please include a reproduction? |
I have edited the description of my issue and included the reproduction repo. I hope this explain the problem . Thank you !! |
I'm testing this on a windows machine and the only way I can get it to fail is if I'm using WSL. This is because filesystem events are not delivered from windows to the WSL2 virtual machine. Are you by chance using WSL for your projects? |
After a bit more testing:
More specifically, for me, it works:
It doesn't work in the following cases:
|
If you are using WSL you can configure Vite internally to use polling and it should fix any issues: const config = {
kit: {
adapter: adapter(),
vite: () => ({
server: {
watch: {
usePolling: true,
}
}
}),
}
} |
I am also using the windows , no VM . Could you please link a working Sveltekit repo with tailwind so I can try it on my machine too. I know if it's working on your machine then it means this is becoming an individual issue (mine) rather than Tailwind's . but could you please link a working repo. Thank you!! |
I cloned the repo you provided and was testing with that.
Out of curiosity does the polling solution I provided work for you? It's not ideal but might fix your problem. |
I have tried with the polling solution as well but it still doesn't work. |
I think I might have found what the problem is but don't know the solution. In content field of config file. I replaced P.S : I also have tried using glob pattern for each file extension like |
That's very strange. What's the full path to the root of your project in Windows? It seems that globs aren't working but that's not something we control but could be worth filing a bug. |
Also any chance you're accessing the path via a UNC path? It'd look kinda like one of these:
|
Ok it's working now . |
I wouldn't expect either of those to be a problem but I've had issues in other tools with Windows and paths having spaces in them. This is good info! I'll see what I can figure out. |
Thank you again for replying to me consistently and helping all the way. |
For my (or others) future reference in debugging this later:
|
Tracked it down and opened a PR with Vite: vitejs/vite#7081 |
What a rollercoaster! I'm going to close this since the issue is upstream, but at least there's a workaround and hopefully the fix will be merged and released there at some point in the near future. |
Leaving this here in case Google takes someone else here too, I'm on a Mac and had a similar issue of changes not being picked up when using glob patterns: Updating my postcss-cli from v8 to |
What 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: [], }
The text was updated successfully, but these errors were encountered: