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

Doesn't work with Nuxt 3 SSR #102

Open
mrleblanc101 opened this issue Jan 17, 2023 · 4 comments
Open

Doesn't work with Nuxt 3 SSR #102

mrleblanc101 opened this issue Jan 17, 2023 · 4 comments

Comments

@mrleblanc101
Copy link

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 ?

@neural-loop
Copy link

I have the same issue with quasar.

@strife-cloud
Copy link

use seems to doing the work at the moment

@akereachu
Copy link

akereachu commented Aug 27, 2023

Just Wrap it like so:
<client-only placeholder="Loading..."> <DisqusCount shortname='your_shortname_disqus' identifier="/blog/1" /> </client-only>

@fgd007
Copy link

fgd007 commented Nov 16, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants