The rewritten title is: __vite_ssr_import_1__.Client is not a constructor error
P粉257342166
P粉257342166 2023-12-20 15:40:15
0
1
674

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粉257342166
P粉257342166

reply all(1)
P粉668146636

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
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template