Live data from Hacker News

Next.js is infuriating

blog.meca.sh

371–380 of 602 posts

Re: Next.js is infuriating

#372
Folks will deal with all of this crazy stuff just to avoid using Ruby on Rails, Phoenix, Django, etc. Why? Is Next.js that much better for the user? I doubt it.

Re: Next.js is infuriating

#373

Maybe this is a good place to ask... but I was actually considering Next.js as a replacement for Gatsby.js project that is a few years old, but is growing at a steady pace. Given all the negative sentiments, what are better alternatives? I don't even use any SSR, or GraphQL capabilities. The main thing I liked about gatsby vs previous "bring your oown library(router)" are: very little configuring, nice dev server, ea…

Say anything negative you could possibly say about Next ... and it will apply a thousandfold to Gatsby. Likewise React Router is ... the example I use when I want to tell someone about a terribly engineered library. As you said, there are multiple React Routers, because the developer is completely incompetent, and has no idea what he is doing. As a result, he changes the entire library in massive, backwards-incompati…

Any thoughts on the Tanstack libraries? We use their query library, and ironically, it reminds me of ext.js tiny bit, but it's been pretty consistent.

Re: Next.js is infuriating

#374
Posts like this really mean "this doesn't work like I expect it to based on my background with some other technology".

But in this case, I tried in earnest to use nextjs for a project with auth & stripe, etc. this past week, and I can't believe how frustrating it is to get stupid things like modal dialogs to work properly in the client.

I have tons of experience with React SPAs. But the client/server divide in Next remains quite inscrutable to me to the extent that I'm just going to start again with Django (where I nearly started it in the first place).

So yes, it doesn't work like I expect it to either...

Re: Next.js is infuriating

#375

> In general Next.js has so many layers of abstraction that 99.9999% of projects don't need. This true to most software projects that are used more than one set of people. Joe Armstrong proposed a solution that we should opensource functions only and people could assemble everything else using these opensource functions. I start to think that he might be right and instead using "frameworks" we should use these set of…

The Unix philosophy?

Every DOM element is a file. And you can use ioctl from JavaScript for anything that doesn't fit neatly into a one dimensional stream of bytes.

Re: Next.js is infuriating

#376

I 100% agree. I've ran into the same issues, and I would never use Next.js for anything, and I will encourage every team at work to use something else. In general Next.js has so many layers of abstraction that 99.9999% of projects don't need. And the ones that do are probably better off building a bespoke solution from lower level parts. Next.js is easily the worst technology I've ever used.

It's almost like the channeled the same problems and bad juju that plagued ext.js.

Re: Next.js is infuriating

#377
post #314

Earlier quoted context omitted.

I've been running a SaaS on Next.js + GraphQL for 4.5 years now, sticking to Pages router has eliminated most of the complexity. I recently rewrote my auth to use better-auth (as a separate service), which has allowed me to start moving entirely off Next.js (looking at either React Router 7 or Tanstack Router). Back when I started, Next.js made server side rendering incredibly easy, but it turns out I didn't need it.…

I would recommend React Router over Tanstack. I tried both and RR was so much easier and more reliable. Tanstack seems to be following Next.js in that they’re just over complicating everything and their docs felt lacking for the most of their features.

I've only ever used Tan's React-Query and I absolutely love it inside of a React codebase.

https://tanstack.com/query/v5/docs/framework/react/overview

Re: Next.js is infuriating

#378

I 100% agree. I've ran into the same issues, and I would never use Next.js for anything, and I will encourage every team at work to use something else. In general Next.js has so many layers of abstraction that 99.9999% of projects don't need. And the ones that do are probably better off building a bespoke solution from lower level parts. Next.js is easily the worst technology I've ever used.

My biggest problem with it now is the official React team pushes it as their framework of choice. Back when it used the Pages Router and wasn't trying to push everything into server components, etc., it wasn't terrible but I can't help but feel bad for any newcomers trying to learn web development.

I switched to Astro from Next for most projects and haven't looked back. It's such a breath of fresh air to use.

Re: Next.js is infuriating

#379

Earlier quoted context omitted.

What did you use instead?

People will complain about Next but there is no perfect solution. The complexity driving the problems with Next materialize in other forms elsewhere. Remix is a competitive option with its own quirks. You can always roll your own with Vite, Tanstack router, etc. but then of course you're manually implementing the same stuff albeit better suited to your needs. Which isn't necessarily bad but it's not the right choice…

Lightweight native web components rendered on the light dom with lit-html and a simple API layer in express 5 is about as close to perfect as I've ever found.

The only "weakness" is that it doesn't have guard rails, so may not be great for larger teams with mixed experience.

Re: Next.js is infuriating

#380
post #312

Earlier quoted context omitted.

While the "Remix" renaming / branding is a little confusing, the React Router team has always done a fantastic job delivering a robust solution that properly leverages the web as the platform. Its framework mode (fka "Remix") is simpler and better than Next.js, and more featureful than vite-ssr. Want to mutate data? Use a form. Fetch data? Uses browser-native fetch under the hood. It's all about the fundamentals: HTM…

their issue with breaking changes is from way before the Remix days - React Router introducing massive breaking changes at every major that required significant rewrites was already a running joke of the community

Their documentation was also abysmal the last time I used their product.
Post reply on HN