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.
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
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
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.
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
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?
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 browserThanks a lot, the websites you have linked to your profile are dope.
I'm glad you think so haha