S
SolidJS3w ago
Luka

Sevoral

Hey I am frequently getting sevoral errors I am guessing its parsing library, couldn't find documentation about it.
So I noticed it happens when I don't use JSON.stringify when sending data from server or don't use solidstart built in json function. If you could explain me how these work and link me documentation about Sevoral it would mean a lot.
7 Replies
Brendonovich
Brendonovich3w ago
Can you share the errors your getting? Seroval is here, and I'm guessing you're returning types like classes that it's not able to serialize
Luka
Luka3w ago
I fix seroval errors easily but I just used JSON.stringify on server and then parsed it on the client. but I wanted to know more about it. I really typed Sevoral LoL. Thanks @Brendonovich, I am working with mongodb so it might be giving me error because of ObjectId's and other types.
Brendonovich
Brendonovich3w ago
Oh yeah ObjectId is a common one You don't necessarily have to stringify, just convert it to a plain object and seroval can take care of the rest, but i don't think Start will support serializing ObjectId and the like in future
Luka
Luka3w ago
I will ask you another question about cache function, I do understand keys and revalidating but I want to know when I revalidate the cache key does it only run function on server? or does it fetch from client as well?
Brendonovich
Brendonovich3w ago
It will run whatever you've put inside the cache - if it's a server function, it'll only run on the server. If it's a manual call to fetch then it'll run on the server during SSR and client in the browser
Luka
Luka3w ago
Thanks a lot, the websites you have linked to your profile are dope.
Brendonovich
Brendonovich3w ago
I'm glad you think so haha