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

Hydration mismatch on BNavItemDropdown with v0.17 #1844

Open
6 tasks done
ptdev opened this issue Apr 15, 2024 · 5 comments
Open
6 tasks done

Hydration mismatch on BNavItemDropdown with v0.17 #1844

ptdev opened this issue Apr 15, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ptdev
Copy link

ptdev commented Apr 15, 2024

Describe the bug

Adding a BNavItemDropdown inside a BNavbarNav triggers a hydration mismatch on Nuxt.

Reproduction example is using the example from the documentation

Reproduction

https://stackblitz.com/edit/nuxt-starter-g6bzks?file=layouts%2Fdefault.vue

Used Package Manager

yarn

Validations

  • Have tested with the latest version. This is still alpha version and sometime things change rapidly.
  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@ptdev ptdev added the bug Something isn't working label Apr 15, 2024
Copy link

stackblitz bot commented Apr 15, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@xvaara
Copy link
Contributor

xvaara commented Apr 17, 2024

@VividLemon if the :to in teleport is undefined, the disabled teleport won't render in ssr 😆

there is even a pull request about it for months: https://github.com/vuejs/core/pull/9783/files

:to="teleportTo || 'body'" fixes this, should we add that to all the teleports? Since body is the only element we can count that is there...

Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity. It will not be auto-closed

@github-actions github-actions bot added the stale There has been no additional replies or questions and the thread is assumed closed label May 17, 2024
@rhelling
Copy link

Had the same issue, thanks to @xvaara hints i ended up with the following work-a-round. Keep in mind the id-prop needs to be specified too, else it will generate one on server which differs from the client generated id.

<BNavItemDropdown
  id="someId"
  :teleport-disabled="true"
  teleport-to="body"
> ...
</BNavItemDropdown>

@github-actions github-actions bot removed the stale There has been no additional replies or questions and the thread is assumed closed label May 21, 2024
@ptdev
Copy link
Author

ptdev commented May 22, 2024

Thanks @rhelling

I can confirm that we no longer get hydration errors after applying your workaround.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants