Closed rizen closed 9 months ago
Note that this happens with other things that display icons also. For example if you:
<Message severity="error" :closable="false">
message goes here
</Message>
Message causes the same problem when trying to display the icon related to the message severity when you get a server side render of this control. And again wrapping it in <client-only>
will fix the error.
Hi,
This issue has already been fixed in the next version. Best Regards,
Describe the bug
While using PrimeVue 3.47.2 with Nuxt 3.10.0 (but this also happens with older versions as well) if you add the
sortable
attribute to a DataTable Column and then refresh the page to get a server side render of the page, you'll get a hydration mismatch. It appears to have something to do with the sort icon.It might be that you should be generating IDs using Nuxt 3.10's new useId composable.
Here's the really ugly error message:
[Vue warn]: Hydration attribute mismatch on "
Reproducer
https://stackblitz.com/edit/primevue-nuxt-issue-template-r2uh4n?file=app.vue
PrimeVue version
3.47.2
Vue version
3.x
Language
ES6
Build / Runtime
Nuxt
Browser(s)
Safari 17
Steps to reproduce the behavior
sortable
to a DataTable Column.Expected behavior
No error should be generated in the console log. If you either remove sortable or wrap the DataTable in client-only then it works fine.