Description
I have identified an inconsistency when using SSR with Pinia Colada related to errored states.
The following line performs a refresh
of any useQuery
usage inside the onServerPrefetch
block. This only gets executed on the server side but causes inconsistent behaviour in relation to errors as errors are thrown due to the refresh(true)
being used.
Lines 203 to 205 in 2b5057e
I'm not sure I fully understand why there is an explicit refresh call on SSR as if you set it to enabled it seems to evaluate the query anyway but setting throw on error makes it so that you cannot use a query that may error with SSR.
Not sure if this is a bug or a explicit design decision but it does restrict where Pinia Colada can be used as you cannot control this behavior from during SSR.
Should we consider removing this onServerPrefetch
block entirely or at least change this line to refresh(false)
to stop throwing the errors?
Metadata
Metadata
Assignees
Projects
Status