You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#23462 introduced headers option value as one of the hash components for useFetch requests. This however broke the example of supplying headers: useRequestHeaders() as shown in docs, because on server side and client side the supplied value are different (on client side it will always return an empty object). This results in a cache miss and triggers a re-fetchdata being null on hydration.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Just hit this too and found that the opts.headers is part of the key hash, which is different between server and client when using cookie forwarding.
A workaround is to supply your own unique key in the useFetch options (or to use useAsyncData, even works without specifying the key manually as the first argument).
Environment
Reproduction
https://stackblitz.com/edit/github-mgk9r8
Describe the bug
#23462 introduced
headers
option value as one of the hash components for useFetch requests. This however broke the example of supplyingheaders: useRequestHeaders()
as shown in docs, because on server side and client side the supplied value are different (on client side it will always return an empty object). This results in a cache miss andtriggers a re-fetchdata
beingnull
on hydration.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: