primevue icon indicating copy to clipboard operation
primevue copied to clipboard

Primevue 4 theme flashing on hard reload (Nuxt 3.11)

Open katerlouis opened this issue 1 year ago • 8 comments

Describe the bug

image image

Reproducer

//

PrimeVue version

4 rc1

Vue version

3.x

Language

TypeScript

Build / Runtime

Nuxt

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

I expect the theme to be there immediately, just like with PrimeVue 3– is this even possible under the new Theming engine?

katerlouis avatar Jun 15 '24 11:06 katerlouis

Hello,

Do you use @primevue/nuxt-module?

mertsincan avatar Jun 16 '24 01:06 mertsincan

I have the same problem, and I do use @primevue/nuxt-module. I think it's the timing of the loading of the styles that's causing the problem, but I can't find the way to control the styles loading.

BoBo-Git avatar Jun 20 '24 11:06 BoBo-Git

Same problem! Html document render before css loaded. But how can we solve it?

jerryisbusy avatar Jun 28 '24 16:06 jerryisbusy

Interesting! I couldn't replicate it. Could you please attach a sample project with your config for us to replicate?

mertsincan avatar Jul 09 '24 08:07 mertsincan

@katerlouis Do you find fix pour that ? I had the same thing and the only fix i found was to disable auto import and declare my components manually. it solved the css import bug.

  primevue: {
    autoImport: false,
    components: {
      include: ['DatePicker', 'Select', 'Menu', 'ProgressBar'],
    },
    options: {
      theme: {
        preset: Aura,
      },
    },
  },

For information :

"nuxt": "^3.12.4",
"primevue": "^4.0.1",
"@primevue/nuxt-module": "^4.0.1",
"@primevue/themes": "^4.0.1",

Kamsou avatar Jul 24 '24 08:07 Kamsou

I have the same issue with primevue 4.2.1

The issue also arises when importing a component manually, whether autoimport is enabled or not.

ilyasturki avatar Nov 04 '24 01:11 ilyasturki

I'm also having this issue, made a minimal sandbox here which demonstrates it: https://codesandbox.io/p/devbox/priceless-boyd-yw69c7?workspaceId=2eeaa102-0506-45c1-93d0-078fad731f2a

Jazcash avatar Nov 10 '24 14:11 Jazcash

Same issue, have been happenning for a few months, some components (Button) are fine but some (InputNumber) will flash unstyled: https://starter-fullstack.is-the.top https://github.com/NamesMT/starter-fullstack

NamesMT avatar Nov 16 '24 14:11 NamesMT

this is happening to me as well, with "@primevue/nuxt-module": "^4.2.5", and "nuxt": "^3.14.1592",

using the menu component:

https://github.com/user-attachments/assets/8e95e082-8729-4e40-b6d8-447ecc5df0a9

alextana avatar Dec 17 '24 01:12 alextana

this is happening to me as well, with "@primevue/nuxt-module": "^4.2.5", and "nuxt": "^3.14.1592",

using the menu component:

Screen.Recording.2024-12-17.at.01.41.24.mov

in my case it doesn't seem to happen on the production build but just on development

alextana avatar Dec 17 '24 01:12 alextana

I have the same problem. Any updates from the June? How it can be fixed?

ostrui avatar Jan 03 '25 16:01 ostrui

Same here. Happening on Nuxt 3.15.1 and PrimeVue 4.2.5

mavyworx avatar Jan 11 '25 20:01 mavyworx

Same here. Happening on Nuxt 3.15.1 and PrimeVue 4.2.5

I made a temporary trick but I am not sure of it's effectiveness and impact on SEO optimization. Still waiting for any reply from primevue team..

app.vue

onMounted(() => {
  // TODO remove after primevue fix
  setRootLoadedClass();
});

method

export function setRootLoadedClass() {
  document.documentElement.classList.add('loaded');
}

base app styles

:root {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

:root.loaded {
  visibility: visible;
  opacity: 1;
}

ostrui avatar Jan 12 '25 15:01 ostrui

Duplicate https://github.com/primefaces/primevue/issues/3070

cagataycivici avatar Apr 29 '25 14:04 cagataycivici

Due to PrimeTek's demanding roadmap for PrimeVue and the limited bandwidth of the core team, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution! :sparkles:

github-actions[bot] avatar Apr 29 '25 14:04 github-actions[bot]

@cagataycivici both this and #3070 is closed, need reopen one of them.

NamesMT avatar Apr 29 '25 14:04 NamesMT

Same here. Happening on Nuxt 3.18.1and PrimeVue 4.3.7

farshidpg avatar Aug 24 '25 01:08 farshidpg