Skip to content
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

MenuBar: Hydration Errors in v3.51.0 #5541

Closed
rickngo opened this issue Apr 5, 2024 · 5 comments
Closed

MenuBar: Hydration Errors in v3.51.0 #5541

rickngo opened this issue Apr 5, 2024 · 5 comments

Comments

@rickngo
Copy link
Contributor

rickngo commented Apr 5, 2024

Describe the bug

After updating to v3.51.0, I am now receiving hydration errors for the MenuBar component. This is occurring on Chrome (Windows and Mac) and Firefox, that I've tested so far.

When I downgrade to v3.50.0, there are no hydration errors

Reproducer

https://stackblitz.com/edit/primevue-nuxt-issue-template-a9mcrv?file=components%2FNavBar.vue,app.vue,package.json,package-lock.json

PrimeVue version

3.51.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Nuxt

Browser(s)

No response

Steps to reproduce the behavior

Please see Stackblitz. I created a MenuBar component with routes and rendered it in the App

Expected behavior

No hydration errors

@rickngo rickngo added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 5, 2024
@rizen
Copy link
Contributor

rizen commented Apr 7, 2024

+1

@i7slegend
Copy link
Contributor

i7slegend commented Apr 7, 2024

relates to #5486

i think i never win this SSR 🥲

@nakku-tricks
Copy link

+1

@Yves852
Copy link

Yves852 commented Apr 19, 2024

As a solution you can provide an SSR-friendly id with useId() in Nuxt >= 3.10:

<script setup>
+  const MenubarId = useId()
</script>

<template>
    <Menubar
+     :id="MenubarId"
      :model="items"
    >
        <!-- ... -->
    </Menubar>
</template>

https://nuxt.com/docs/api/composables/use-id
https://primevue.org/menubar/#api.menubar.interfaces.MenubarFocusedItemInfo.parentKey

@tugcekucukoglu
Copy link
Member

Sorry for the confusion. It will be fixed for the next version.

@tugcekucukoglu tugcekucukoglu removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants