-
Notifications
You must be signed in to change notification settings - Fork 45
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
ReferenceError: document is not defined (nuxt3) #89
Comments
This answer might solve your problem #88 (comment) I'm not an expert in Vue, but I'd assume, you'll have to use |
Yes, I've seen that one. But I'm not sure where to include that? In the same component or plugin? Can you please guide me? |
Thank you. |
The entire solution should look like <template>
<ImgComparisonSlider hover="hover">
<figure slot="first" class="before">
<img
class="h-72 w-full object-cover"
src="https://sneas.github.io/img-comparison-slider/demo/images/before.webp"
/>
<figcaption>Before</figcaption>
</figure>
<figure slot="second" class="after">
<img
class="h-72 w-full object-cover"
src="https://sneas.github.io/img-comparison-slider/demo/images/after.webp"
/>
<figcaption>After</figcaption>
</figure>
</ImgComparisonSlider>
</template>
<script lang="ts">
import { defineComponent, defineAsyncComponent } from 'vue'
export default defineComponent({
name: 'App',
components: {
ImgComparisonSlider: defineAsyncComponent(() => import('@img-comparison-slider/vue').then(({ImgComparisonSlider}) => ImgComparisonSlider
))
},
})
</script> I can see that |
Okay thanks, I'm also trying... |
I think this is a bug in the Vue implementation of If dynamic import has solved |
No, It has not solved the issue of |
Here is the working example https://github.com/sneas/img-comparison-slider-nuxt |
In nuxt-config.js, at the plugin part:
|
I am using the following ecosystem:
I have imported the
ImgComparisonSlider
in the component as below.I have tried using it without the
<client-only>
tag as well.File :
myComponent.vue
The error I am getting is
document is not defined.
Error Log
The text was updated successfully, but these errors were encountered: