Closed suhail-chouhan closed 8 months ago
I also encountered the same problem, and there was no problem if I specified the for
attribute.
<q-input for="everthing"/>
I ran into the same problem.
I also get this warnings and errors after I updated to
"quasar": "^2.14.2", "vue": "^3.4.15", "@quasar/app-vite": "^1.7.3",
Hydration completed but contains mismatches.
for QInput, QSelect - id
and for
attributes
I also have a block in which a background is randomly selected when the page loads, so now I also get a warning for the style
attribute, although there was none before the update.
- rendered on server: style="background-image:url(/src/assets/images/search-bg5.jpg);background-position-y:36%;--bg-gradient:linear-gradient(180deg, rgba(62, 68, 91, 0.60) 0%, rgba(62, 68, 91, 0.60) 100%);"
- expected on client: style="background-image:url(/src/assets/images/search-bg1.jpg);background-position-y:top;--bg-gradient:linear-gradient(180deg,rgba(61, 68, 92, 0) 20.72%,#3e445bcd 100%);"
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
You should fix the source of the mismatch.
at <SearchBanner>
at <QPage class="flex flex-center column fit" >
at <IndexPage onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > >
at <RouterView>
at <QPageContainer class="fit q-page-container--custom" >
at <QLayout view="lhr LpR lfr" >
at <MainLayout onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > >
at <RouterView>
at <App >
at <AppWrapper>
This seems like a bug in Vue 3.4... will investigate more.
Indeed there have been substantial changes in Vue 3.4 which break Quasar UI for SSR. Found a workaround for the issues with QField/QInput/QSelect/... and QBtnDropdown, QExpansionItem, QFab).
Will be available in 2.14.3
Investigating one more possible issue.
Fixed the additional issue (Dark plugin) generated by the changes in Vue 3.4 #16818
All fixes will be available in 2.14.3
@rstoenescu Is there a way we can expose a sort of useId
helper from Quasar that can be used by the developers? For example: In my project I have a wrapper around QInput that can render a label above the input as well. This label should have the correct for
tag so I was generating the id myself. Only workaround I see so far is just generate the ID in the onMounted
hook so it does not trigger a mismatch but that feels a bit wacky. Maybe you got another idea?
@rstoenescu Is there a way we can expose a sort of
useId
helper from Quasar that can be used by the developers? For example: In my project I have a wrapper around QInput that can render a label above the input as well. This label should have the correctfor
tag so I was generating the id myself. Only workaround I see so far is just generate the ID in theonMounted
hook so it does not trigger a mismatch but that feels a bit wacky. Maybe you got another idea?
Nothing wacky about it. But regardless, a new composable useId()
will be available publicly in Quasar v2.15
What happened?
Adding a q-input gives console errors in SSR Mode as Hydration Attribute Mismatch.
What did you expect to happen?
It should work fine and not return any error
Reproduction URL
https://stackblitz.com/edit/stackblitz-starters-7zbdni
How to reproduce?
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Components (quasar)
Platforms/Browsers
Chrome
Quasar info output
Relevant log output
Additional context
the issue persist with q-drawer as well