-
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
[JIT] Using vite does not update the generated CSS #4073
Comments
I can reproduce the same behaviour with on Mac and Windows, with
Additionally, what I see:
Sometimes JIT can run faster than Webpack, at which point the page displays normally without reload. What I think needs to be done is:
|
hi, same thing here. node: v14.15.1
tailwind: 2.1.1
angular: 11.2.7 We need to restart our dev server to see the new classes applied. |
Im wondering... Could tailwind JIT when working with webpack, somehow make webpack hmr wait with its refresh for JIT compile? Or call it again after finish? |
I can confirm having this bug in NextJS like #4081 intermittently with no way to tell if it's going to occur or not. It does occur (without any visible error) if I include a Tailwind plugin that is missing or PostCSS configuration file that is invalid. But it also occurs for no apparent reason, and with no obvious output that's different. JIT not working -- no JIT message, webpack warning: JIT working -- JIT message, no webpack warning: These are the same project with
Here's the list of everything I tried, but nothing seemed to make a difference:
I think @danon is on the right track with there being some type of a race condition. Nice job with that research! 👍 |
To address the original issue: it is solved by upgrading The other issues mentioned in this thread are not related to vite or svelte, so please open new issues with reproductions if you're having problems, thanks! |
@bradlc / @adamwathan - I'm having a similar issue with ~/ ❯❯❯ yarn build-watch ◼
yarn run v1.22.5
warning package.json: No license field
$ vite build --watch
vite v2.3.4 building for production...
watching for file changes...
build started...
✓ 24 modules transformed.
dist/index.html 0.54kb
dist/assets/index.06bb62fb.css 3394.85kb / brotli: skipped (large chunk)
dist/assets/index.f70af79e.js 1.08kb / brotli: 0.55kb
dist/assets/vendor.89272c9c.js 64.46kb / brotli: 22.64kb
built in 12138ms.
build started...
✓ 25 modules transformed.
dist/index.html 0.46kb
dist/assets/index.14cb56db.js 1.06kb / brotli: 0.54kb
dist/assets/vendor.89272c9c.js 64.46kb / brotli: 22.64kb
built in 1774ms. Changing Update: Interestingly, if I save tailwindcss: 2.1.2 |
@bradlc - The issue I described above seems to be related to |
@klongmitre This issue is closed, please open a new one with a reproduction if you're having problems 👍 |
For anyone it might help, I had the same problem even with the latest versions of svelte, vite and tailwind. I found that the problem was that I was including tailwind in my __layout.svelte as follows:
It turns out that by creating a separate |
@nikosgpet THANK YOU! I was banging my head against the wall with the same issue until I came across your post. In my case, I am not using SvelteKit, just Svelte for a SPA. I was using the same pattern to pull in Tailwind styles in my root
I moved that to a
Then I imported that from my
And voila, it worked. Also, VSCode started complaining about |
Another method I've seen is that instead of creating another css file, you can just import It's not mentioned by the tailwind team, so I'm guessing they not fully onboard with using this method (yet). |
What version of Tailwind CSS are you using?
v2.1.1
What build tool (or framework if it abstracts the build tool) are you using?
vite 2.1.5
What version of Node.js are you using?
15.14.0
What browser are you using?
Chromium
What operating system are you using?
Linux, macOS
Reproduction repository
https://github.com/nachtjasmin/vite-tailwind-jit-bug
Describe your issue
When I am running vite in development mode, using
vite
oryarn dev
, the page of my svelte component is correctly refreshed. However, the CSS does not change.E.g. in the reproduction repo, when changing the background of the div in
App.svelte
frombg-blue-500
tobg-red-500
does not do anything, reverting this change shows the old css and therefore a blue rectangle. When restarting the build server, the correct css is generated.Could be related to #3950.
The text was updated successfully, but these errors were encountered: