Error boundary wont catch error
i have /services/[service_id] that fetch service information from graphql server which will throw error when theres no service information on that id. i wrap the component with error boundary and suspense but when i go to /services/blablabla (which doesnt exist) it doesnt show error boundary fallback but an renderString timeout, here are the error:
8 Replies
here are the code:
the fetch function
the gqcall function
am i missing something? in the terminal the error is being logged but error boundary wont show the fallback component
Help plss its the last error that i need to solve im this is just a personal project ill upload it in github if more detail is needed
Im stuck
honestly uploading the svg file of the "highlighted code" is just tedious to check into. Could you please upload the PNG format or to simplify things, just paste the code directly here?
No png would ruin the code the code is too long
aight i simplify it
it seems that you're using
renderToString
while expecting an error from a Promise
This is expected behavior. You might want to try renderToStream
or renderToStringAsync
insteadIn what
In the entry-server?
I changed it to renderStream, it does fix the timeout but the error boundary still wont catch the error