Development Class Changes Not Properly Applied After Page Reload In Nuxt >=3.1.1

This issue has been tracked since 2023-02-19.

Version

@nuxtjs/tailwindcss: 6.4.1
nuxt: >=3.1.1

Reproduction Link

https://github.com/JacobLindelof/nuxt-tailwind-testing

Steps to reproduce

  1. Install dependencies.
  2. Run dev server.
  3. Change BG color class in app.vue.
  4. Refresh page.

What is Expected?

Changed be color correctly appears one page is refreshed.

What is actually happening?

Previous state before changes are sent to the client instead.

This issue does not re-produce on CodeSandbox, but I have duplicated it with the given repo on my desktop and laptop. Both running windows. Maybe the issue is somehow windows related? Downgrading Nuxt from 3.1.1 to 3.1.0 does fix the issue so not sure if the issue is something in Nuxt or the Tailwind module.

Code_Hqjf5SaQbr

Skyward176 wrote this answer on 2023-02-27

Reproduction

Im getting something similar where I set a flex layout, it works. I refresh, and it breaks.

Since I think it's similar to yours, I'd like to expand upon the issue I'm having. I make a change, it updates on the page. I refresh the page, that change goes away. If I make the change again, it will appear on the dev server once more. But again it disappears after a refresh. They styles don't apply if I build the project. I'm using a mac, yarn, and node 18 lts. Using Nuxt Tailwind 6.4.1, Nuxt 3.2.2.

I haven't noticed a consistent pattern, however this doesn't happen with every element.

JacobLindelof wrote this answer on 2023-02-27

Your issue is basically the same as mine. I've noticed all of the same behavior as you. For what its worth downgrading to Nuxt 3.1 does fix the issue completely, and you're not missing out on too much.

I haven't fully tested it, but I think the same behavior happens if you install Tailwind without using the module as well which might indicate that it's actually an issue in the main Nuxt package instead of the module.


I can reproduce the bug using vanilla tailwind as well on this branch. https://github.com/JacobLindelof/nuxt-tailwind-testing/tree/tailwind-no-module


image

I also noticed that when trying to debug the issue on Stackblitz whenever the page refreshes I get a Vite server hmr X files console message, but on my computer I don't get any hmr messages.

Similar issue here vitejs/vite#10270

Skyward176 wrote this answer on 2023-02-27

I've also noticed the issue with straight tailwindcss, installed manually. However, downgrading to Nuxt 3.1.0 has made no difference for me.

fouteox wrote this answer on 2023-03-01

Hi, I have exactly the same problem here.

More Details About Repo
Owner Name nuxt-modules
Repo Name tailwindcss
Full Name nuxt-modules/tailwindcss
Language TypeScript
Created Date 2019-04-04
Updated Date 2023-03-29
Star Count 1285
Watcher Count 12
Fork Count 157
Issue Count 57

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date