SSR mismatch using b-dropdown with slot
See original GitHub issueHello,
When using b-dropdown
with a custom slot, like this (straight from the doc) :
<b-dropdown variant="link" size="lg" no-caret>
<template slot="button-content">
Click Me !
</template>
<b-dropdown-item to="/whatever">
Link 1
</b-dropdown-item>
<b-dropdown-item to="/nowhere">
Link 2
</b-dropdown-item>
</b-dropdown>
I get the following SSR error :
[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.
Environment:
- macOS 10.13
- nuxt 2.3.4
- bootstrap-vue 2.0.0-rc.11
Is there a workaround ? Thanks ! 😃
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
SSR and keep-alive issue in Vue 3: dynamic component
Hydration completed but contains mismatches. What shall I do to fix this issue? javascript · vue.js · server-side-rendering ...
Read more >Removing and replacing a memory module (IBM SSR task)
You can remove and replace a faulty dual in-line memory module (DIMM) from a control enclosure. You can also use this procedure to...
Read more >Server side rendering - Radix UI
Server side rendering or SSR , is a technique used to render components to HTML on the server, as opposed to rendering them...
Read more >A deep analysis into isomorphic, autonomous cross ... - ITNEXT
Nested components have to be slotted (as described above) and are therefore NOT inside of the rendering path of the parent component but...
Read more >@vue/server-renderer | Yarn - Package Manager
... you no longer need to explicitly install this package and ensure its version match that of vue 's. Just use the vue/server-renderer...
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
@jschoedt
There are issues with your markup.
You are telling
list-group-item
to render as a<button>
element (via thebutton
prop), and then placing a dropdown inside of that<button>
(which the dropdown includes a<button>
, as well as other content not allowed inside of that list group button<button>
). So it is creating invalid HTML markup (you can’t have a<button>
inside of another<button>
), which the browser is “fixing” when it tries to hydrate. SRR blindly renders the invalid markup, but the browser when it sees that markup is removing things that aren’t allowed in the button (or placing bits outside of the button).Use markup similar to below to get valid HTML markup:
You are right. Thanks for pointing that out. Removing the button attribute fixed it.