N
Nuxt3mo ago
Cesxhin

[RESOLVED] Problem with modules

I am using modules which is used exclusively internally. I noticed that some parts give me a warning about the Hydration problem. What am I doing wrong? Why is he doing this?
No description
2 Replies
Eric
Eric3mo ago
can you show the code in sideMenuMayout and also the code where you import in a page/component?
Cesxhin
Cesxhin3mo ago
Maybe I understood the problem but I don't know how to solve it. I basically have a pinia store located in modules. I have a plugin only on the client side that sets a role of the logged in user. When that given component arrives it is done in the ssr and is found role in default therefore zero. OK I solved it. The problem was precisely that the init plugin was set only on the client side and consequently on the server side it had another value and Hydration Mismatch was triggered. The reason I put plugins only on the client side is because I used axios and it doesn't have the instance to be able to access the server side as well. So I implemented nuxtjs useFetch and now everything seems to work with the plugin both server side and client side. I hope this message is useful for someone.