Closed praburangki closed 3 years ago
Hello @praburangki ;
I know that this happens, actually I do have the same problem using VitePress (for the @vueuse/motion docs).
I'm actually investigating about this error, as this is only happening on Vue 3 with SSG, this is completely undocumented and needs me to dig into the directives implementation of Vue 3.
I think this error (that breaks your build) should only be a warning.
My directive works fine with SSG/SSR (for instance Nuxt 2 runs it well).
I might submit a PR for that really soon, I hope it will be fixed in next Vue version.
As a workaround, you can actually use useMotion
with ref()
, that will be working server-side.
I know this is not the best workaround as it prevents you from using the nice v-motion
directive, but this will be fixed as soon as possible, at least I hope so!
Thank you for your issue, I keep this open and will keep you posted.
๐
Actually I found this, which seem to be a great path to take to solve the problem: https://github.com/intlify/vue-i18n-extensions/tree/c9a529a5fa7e1df4661cd42bee62e980fcd0d631#pre-translation-with-using-v-t-custom-directive
I will try to find out an elegant solution to solve this.
Hey @praburangki ;
@antfu has been providing a fix for the issue causing the errors on build!
You only have to npm install --save-dev patch-vue-directive-ssr
in your repository, and the error will be gone.
I'll be documenting this and add it to the readme.
Once done, this issue will be closed. ๐
I've encountered an error while building, I thought there was something wrong with my configuration then I tried to reproduce using https://github.com/antfu/vitesse.
I've tried using this two approach:
main.ts
:The build script:
cross-env NODE_ENV=production vite-ssg build
and the result of the build returns the message:
What am I missing here? thank you