N
Nuxt2y ago
data

Does navigateTo clear any state set in middlewares?

So I'm using Nuxt 3 and Pinia. In my global middleware, I check if the to.query has a certain key. If this exists, i extract data from it, push it to a pinia store and then redirect the user to a new route with navigateTo. When I try to display the data from the store on that page however, the store is empty. If I don't call navigateTo and just let the route keep going, the state gets filled properly. Inspecting server logs, for some reason it seems like the code inside the page's setup function gets run twice on server. First time with the store state properly set, the second time without... Anyone know whats going on here?
No description
No description
No description
1 Reply
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server