Using SWR Preload throws uncaught runtime error when server is not running #2926
Unanswered
stefan-epic
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a custom ApiService using SWR for Get Requests and would also like to use the Preload function. The issue im facing is when the server is offline(no server at all running on localhost:8080 for example) and I call preload it just shows a uncaught runtime error on the react side.
Here is the Error on reacts side:
Here is my code:
//apiService.tsx
the above referenced fetcher function:
The userServerHealth Hook
And finally the above referenced useGetData hook, which is also located in apiService.tsx
Beta Was this translation helpful? Give feedback.
All reactions