Live data from Hacker News

How to Inspect React Server Component Activity with Next.js and OpenTelemetry

dash0.com

51–52 of 52 posts

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#51
post #5

Earlier quoted context omitted.

Not quite sure what the big challenge is here. If the work is shifting to the server, you debug on the server! Read the logs. Attach a debugger. Instrument the code if you must! All that usual stuff. This is how web-development has been since the days of CGI. What am I missing?

> Read the logs. I've noted a tendency to not log stuff in some js-first devs i know ... they all say 'i'll reproduce it locally'...

Ok genuine question, since I feel like I’m using logs wrong:

How much stuff do you log in the server? I’ve only ever seen devs log basic high-level stuff. But to actually debug something, you need way more information.

I’ve tried sticking debug-level logs that log all sorts of business logic. Pretty much recreating what you would do with console.log when trying to isolate an issue locally.

But then you have your code permanently littered with debug log lines! It makes things… ugly!!

If you NEED detailed logging, do you just deal with the uglified code? Or is there a better solution? Decorators that logs parameters and such automatically??

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#52
post #27
post #16

Earlier quoted context omitted.

It’s awful and I’m pretty sad that it seems the entire nodejs community has adopted next.js as standard. All projects I’ve been involved with use it and none of them use any SSR at all.

That's mostly because `create-react-app` was abandoned. There is no default project template for React SPA, so everyone just uses Next, even if they don't need SSR.

But this works fine, I use it for all my side projects: https://vite.dev/guide/#scaffolding-your-first-vite-project

Add in tailwind and a router of choice (I love wouter) and you've got 90% of what you need to build most applications. Vite is so much simpler than webpack and the rest that came before, it's a tiny amount of work to do this.

Post reply on HN