-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
CSS HMR errors from Tailwind arbitrary value classes #26454
Comments
Start a new pull request in StackBlitz Codeflow. |
Instead of importing the CSS file in the app script, why not include it in the CSS field in nuxt.config? It seems to resolve the issue: https://stackblitz.com/edit/github-4um3z1-ych9wt?file=nuxt.config.ts |
Yes I'm aware of this approach (as discussed by the Tailwind module's developer), but the behavior when CSS is imported in |
Super-quickly looked at this and could not reproduce with the following Vue SSR template: https://stackblitz.com/edit/github-e9jfew?file=src%2FApp.vue,src%2Fpages%2FHome.vue,src%2Fcustom.css - in case it's helpful for someone picking this up later. |
Environment
Reproduction
https://stackblitz.com/edit/github-4um3z1-gdby4j
Describe the bug
When an arbitrary value Tailwind class with whitespace is used (e.g.
font-['Times_New_Roman']
), CSS HMR will throw an error on subsequent hard refreshes.I had originally reported this issue in nuxt-modules/tailwindcss#815, but @ineshbose later discovered the HMR error occurs even with a manual Tailwind CSS setup (without the module), leading me to forward the issue here. Both of us also suspect this could be a Vite bug, but I have not been able to reproduce the issue in a plain Vite project (e.g.
npm create vue@latest
).Error Repro:
@/assets/custom.css
(e.g. changecolor: aqua;
tocolor: magenta;
), then save the file.Additional context
There are some workarounds documented in nuxt-modules/tailwindcss#815 (comment) that might be helpful in deducing what's actually causing this issue.
Logs
No response
The text was updated successfully, but these errors were encountered: