antoniandre / wave-ui

A UI framework for Vue.js 3 (and 2) with only the bright side. ☀️
https://antoniandre.github.io/wave-ui
MIT License
544 stars 39 forks source link

Support for Nuxt 3 #109

Closed R0N1n-dev closed 1 month ago

R0N1n-dev commented 1 year ago

The wave-ui page mentions "Not tested with Nuxt 3". II have a repo with Nuxt 3 set up with wave UI. https://stackblitz.com/github/R0N1n-dev/nuxi-wave But on running the server, it reuns well but for an error about Hydration mismatch as shown in the screenshot below. And it causes issues with hot-reloading.(have to reload page after saving code sometimes). Screenshot from 2023-06-07 10-24-04


antoniandre commented 1 year ago

Hi @R0N1n-dev, Thanks for the repro. I have modified the code a little to remove the hydration problem. https://stackblitz.com/edit/waveui-nuxt3?file=layouts%2Fdefault.vue,nuxt.config.ts,plugins%2Fwave.js

This is still not the ultimate way since Nuxt will try to instantiate Wave UI twice (one time on SSR, one time client side) thus you will see the "Wave UI is already instantiated" warning. this does not matter at all and it will not impact the way Wave UI works since it already makes sure you run only one instance. So you can completely go like this, but for the sake of doing it right, I will develop a Nuxt module for Nuxt 3 / Vue 3 soon.

antoniandre commented 1 month ago

There's now an official documentation how to install on Nuxt 3. https://antoniandre.github.io/wave-ui/getting-started#installation-on-nuxt