Closed Lucas-Gruber closed 4 months ago
I am having the same issue did you get it resolved?
The fix for this issue has already been merged but there hasn't been a new release since then. I have a workaround, but I haven't tested if this works after build, let me know if this works in your project.
In nuxt.config.ts
modules: [
"@vueuse/motion/nuxt",
// removes @vueuse/motion plugin
(_opts, nuxt) => {
nuxt.options.plugins = nuxt.options.plugins.filter(
(x) =>
typeof x !== "string" &&
!x.src.includes("@vueuse/motion/dist/runtime/templates/motion")
);
},
]
And add this plugin plugins/motion-replacement.ts
import { MotionPlugin } from "@vueuse/motion";
import { defineNuxtPlugin, useRuntimeConfig } from "#app";
export default defineNuxtPlugin((nuxtApp) => {
const config = useRuntimeConfig();
nuxtApp.vueApp.use(MotionPlugin, config.public.motion);
});
When is define a custom directive in nuxt.config.ts:
I become following error:
PARRENT_COMPONENT and PARRENT_PAGE replaced with the real component and page of course.