-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Nuxt3 SSR Issue #96
Comments
I have the same issue, any insight into this? I tried wrapping my list in but still get an error in my console: "dir is undefined" |
Nope i'm not able to solve this |
I'm not getting the error on my current nuxt 3 stable. Maybe its resolved? import { autoAnimatePlugin } from '@formkit/auto-animate/vue'
export default defineNuxtPlugin(nuxtApp => {
nuxtApp.vueApp.use(autoAnimatePlugin)
}) |
I have the same issue... need help :( |
Can someone produce a minimal reproduction and post it back to here? Happy to take a look |
I had the same issue with Nuxt 3 and updated my plugin the same as @chris-visser and it worked like a charm |
Okay, so I still experience the same problem, but maybe this is useful to someone. // <your-nuxt-root>/plugins/auto-anim-directive.ts
import autoAnimate from "@formkit/auto-animate"
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.directive('auto-anim', {
mounted: (el, binding) => {
autoAnimate(el, binding.value || {});
},
// we can just return this as an empty object
getSSRProps(binding, vnode) {
return {}
}
})
}) Nuxt should import that directive automatically. Maybe restart your dev server. <script setup>
const toggle = ref(false);
</script>
<template>
<!-- <ClientOnly> -->
<div class="mb-20 m-container" v-auto-anim>
<button class="p-5 bg-green" @click="toggle = !toggle">click me</button>
<div class="bg-red w-20 h-20" v-if="toggle"></div>
</div>
<!-- </ClientOnly> -->
</div>
</template>
@justin-schroeder: Maybe worth giving it a shot? If you want to, i can make a PR. |
Just in case someone wanders in here: Delete |
for anyone got this issue, check your module name in nuxt config file. it has to be
|
The text was updated successfully, but these errors were encountered: