Tailwind CSS classes not imported to CSS without nuxt restart
See original GitHub issueEnvironment
Nuxt CLI v3.0.0-rc.8
Nuxt project info:
- Operating System:
Linux
- Node Version:
v18.6.0
- Nuxt Version:
3.0.0-rc.8
- Package Manager:
yarn@1.22.19
- Builder:
vite
- User Config:
build
,runtimeConfig
- Runtime Modules:
-
- Build Modules:
-
Reproduction
<template>
<div class="">test</div>
</template>
then change it to
<template>
<div class="p-5">test</div>
</template>
and save your file.
Describe the bug
Nuxt server will reload but the CSS for p-5 is not shown in the browser.
Additional context
No response
Logs
✔ Vite server built in 500ms
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
Tailwind CSS classes is not working in my project?
This error is due to tailwind not finding any classes to scan in what it 'thinks' is your HTML code directories.
Read more >Classes not being loaded in dev mode until Nuxt dev server is ...
Class doesn't appear, even after refreshing. Only after nuxt is restarted does the new class get added to the page. OR if the...
Read more >Install Tailwind CSS with Nuxt.js
Using npm, install tailwindcss and its peer dependencies, as well as @nuxt/postcss8 , and then run the init command to generate the tailwind.config.js...
Read more >How to set up and customize Tailwind in Nuxt.js - Mattermost
In this step, you'll learn to create custom components in Nuxt.js, style them using Tailwind CSS classes and import them into a Nuxt.js...
Read more >How to use Tailwind CSS with Nuxt.js | Kevin Regenrek
Table of Contents · 1. Quickstart TailwindCSS with the @nuxtjs/tailwindcss module. a) Start a new nuxt project; b) Add TailwindCSS to an existing ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, I was missing the “buildModules” option in my nuxt config.
New nuxt config which works:
@Joaojack thanks for your kind help!
If i were you I would try to uninstall tailwindcss and install
@nuxtjs/tailwindcss
in devDependencies. Works flawlessly with Nuxt 3. https://tailwindcss.nuxtjs.org/ Config is good as it is (if you had a tailwind.config.js you can keep it too).BTW i think you can keep everything in devDependencies now, that’s what i do since this discussion