Approximating browser "Network tab" request-debugging experience with Server Components #51578
Unanswered
nervestaple
asked this question in
App Router
Replies: 3 comments 8 replies
-
Create a function to make the network requests and whenever there's an error in a request send it to Sentry. Something like: function apiCall(url) {
try {
await fetch(url);
} catch {
if (error) Sentry.captureException(error);
}
}
// And then call this where you need it:
apiCall(url); I wrote this on the fly so use it more as pseudocode than a working example. |
Beta Was this translation helpful? Give feedback.
8 replies
-
following |
Beta Was this translation helpful? Give feedback.
0 replies
-
It looks like theres a product that solves this but +1 I'd love to see this tooling baked into the developer experience |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm enjoying the experience of RSC so far, but from the POV of the rest of my team (non-FE developers), their experience has been negatively affected. Previously they could inspect and debug API calls, even in production, using the Network tab of their browser debugging tools. Now, many those requests are being made in server components, making them completely invisible from the client side, leading to frustrating experiences.
We use Render.com for deployment, and there is some logging i've added on each network request, but in production, especially with many simultaneous users, all the requests become interleaved and picking out individual ones becomes tricky.
Does anyone have any recommendations for tooling or process changes that would make debugging easier for them? Ideally it would approximate the experience of using the Network tab.
Is there a way to get Sentry to do something like this? I have the default Sentry logging setup but it seems focused on errors.
Another idea I had was pushing fetch results & errors to client components using props, and logging them there -- but that's a lot of annoying manual work for each request.
Beta Was this translation helpful? Give feedback.
All reactions