Cesxhin
Problem generic typescript
reproduction: https://codesandbox.io/p/devbox/weathered-brook-g3klnn
8 replies
Problem typescript with modules
Hi guys I'm desperate using typescript with forms.
In the first photo it is a component that is part of a module and fails to describe the object.
Instead in the second photo it is a simple component within the main project and it works.
Why does it fail in the modules? Am I doing something wrong? Thank you
3 replies
[RESOLVED] Problem with modules
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.
4 replies
[RESOLVED] Problem with modules
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.
4 replies