I'm developing a simple application to demonstrate CRUD operations with Appwrite and Nuxt 3 (release candidate 11). The source code for the same can be found here.
I'm using the app's login page (index.vue
) for a simple redirect, i.e. if account
exits in accountStore
, I want to redirect Users are redirected to the /workouts
route, otherwise they are asked to log in by redirecting to the /login
route.
The problem I am facing is that when I land on the index.vue
page (there is no ongoing user session in Appwrite), I am still redirected to the /workouts
route, Instead of the /login
route. I think the same reason is the following error logged in the console.
I need help figuring out where the error message is coming from and how to fix it.
This is my public github repository: https://github.com/EshaanAgg/workout-buddy
P粉6681466362023-12-21 13:53:48
This may be a bug with Nuxt 3 or Vite, as Nuxt 3 is currently only a release candidate.
Also, server-side rendering (SSR) has always made things so complicated in my opinion. You don't appear to be using SSR, so you can update nuxt.config.ts to disable SSR:
{ // ... other stuff ssr: false }