vueuse
vueuse copied to clipboard
Add the defaultWindow variable in order to be able to send fetch requests in an SSR mode
To be able to run a set of code on both the client and server side
@antfu in SSR mode, the component called useFetch, but the fetch function could not be called on the server side, resulting in the request failure. Is it possible to increase the line of code.
Thanks, but window is designed to be undefined on the server side. Instead in useFetch we could try to detect from globalThis.fetch. I am closing this PR - feel free to bring up another approach in another PR.