Showing A Loading Component In Nuxt SPA While Router Middleware Is Resolving
Hi,
I have a Nuxt 3 SPA app (
ssr: false
), where I'm trying to show a loading component while my authentication router middleware is being resolved/awaiting.
Here's my code:
The problem is that the <LoadingComponent> doesn't seem to be mounted before the router middleware is resolved. I thought it was only the pages rendered by <NuxtPage> that was blocked from rendered before any middlewares was resolved.
Does anyone know how to achieve this? Any help is really appreciated π3 Replies
Update: I just tried this with a normal Vue app (without Nuxt) and it works as expected, where the loading component is rendered before the router middleware is resolved
I have tried using the SPA loading template option in Nuxt, but that template is hidden already once the app is hydrated and not when the page loads, so this really hurts the user experience of my app, as the user just sees a blank white page while the middleware is being resolved π¦
Unknown Userβ’9mo ago
Message Not Public
Sign In & Join Server To View
The solution in my case, was to migrate from Nuxt to a simple Vue 3 app π