veaury icon indicating copy to clipboard operation
veaury copied to clipboard

Nuxt 3: Objects are not valid as a React child

Open ekkaiasmith opened this issue 8 months ago • 1 comments

Even with SSR disabled, the same error Objects are not valid as a React child appears in Nuxt 3 projects using Veaury. Is there a minimal working Nuxt 3 template project available somewhere?

ekkaiasmith avatar Oct 11 '23 22:10 ekkaiasmith

Hey! Faced the same problem, and I think I figured this out. The problem is veaury initialized vite vue plugin inside veauryVitePlugins function, and Nuxt 3 do the same under the hood. I don't know exactly how, but seems they are conflicting. The vite vue plugin is the first element of the array which is returned by veauryVitePlugins function. The solution is simple, just to remove first element of the array and then pass it to the vite plugins.

// nuxt.config.ts
import veauryVitePlugins from 'veaury/vite/index.js'

const veaury = veauryVitePlugins({
  type: 'vue',
});
veaury.shift();

...

vite: {
    plugins: [
      veaury
    ],
    ...
},
...

futurfuturfuturfutur avatar Dec 21 '23 12:12 futurfuturfuturfutur