Doesn't work with Nuxt 3 SSR
Probably because you use window in script setup outside the onMounted hook.
const currentRoute = ref(window.location.pathname)
Why not simply use const route = useRoute() and route.fullpath instead of referencing the window ?
I have the same issue with quasar.
use <ClientOnly> seems to doing the work at the moment
Just Wrap it like so:
<client-only placeholder="Loading..."> <DisqusCount shortname='your_shortname_disqus' identifier="/blog/1" /> </client-only>
@akereachu This works for the Disqus component, but with the DisqusCount it will complain about 'shortname' missing:
TypeError: Cannot read properties of undefined (reading 'shortname')
So it needs the shortname when the component loads
Edit:
Using the component like this:
<ClientOnly placeholder="loading...">
<DisqusCount
:shortname="name"
:url="url"
:identifier="id"
></DisqusCount>
</ClientOnly>
Combined with just a local import
import { DisqusCount } from 'vue-disqus'
Using
- Nuxt 3.7.4
- Vue Disqus 5.1.0
- Vue 3.3.4