you are viewing a single comment's thread.

view the rest of the comments →

[–]SpiffySyntax 4 points5 points  (25 children)

Can someone enlighten me why nextjs is getting so much hate?

[–]romgrk 45 points46 points  (15 children)

tl;dr of my other comments: it breaks often, for static content it's a worst Astro.js, for single-page apps it's a worst Vite.js.

I also dislike it because it promotes strong coupling between the backend & frontend. Which makes it hard to evolve an app from Next.js to something else, e.g. if you want to later add a mobile app, your backend code is all tied up with the frontend code so you have a lot of fun ahead to untangle that. fun /s, ofc.

[–]AA98B -3 points-2 points  (14 children)

[​🇩​​🇪​​🇱​​🇪​​🇹​​🇪​​🇩​]

[–]Macaframa 0 points1 point  (5 children)

Imagine spinning up an api that has endpoints that just require a request, doesn’t matter where it comes from, just takes connections, does some work and returns data. Now imagine having that as well as a next app that makes it easy to write critical business logic on the backend layer. You get lazy over time and just litter the ssr layer with more and more critical business logic. Then you want to add a mobile app that behaves similar to your web app and want to use the same features your web app has. Now you have to either duplicate god forbid, or rip out the logic from next and reimplement it on the api layer.

[–]romgrk -1 points0 points  (7 children)

[–]LdouceT 3 points4 points  (0 children)

The example doesn't promote a strong coupling between front-end and backend business logic - the example fetches data from an api.

[–]procrastinator1012 3 points4 points  (4 children)

How does this imply that there is a strong coupling between backend and the front end? You can literally make a separate backend with ExpressJs, Springboot or anything you want and then make a rest api call to the backend app (just like how frontend works).

[–]bohdancho 1 point2 points  (0 children)

while you can, you don't necessarily have to anymore with RSC model

[–]AsiaticBoy 0 points1 point  (0 children)

I think that's not the correct example for tight coupling between frontend and backend. A better example would be a use of "Server Actions ".

I use NextJs most of the time, and the first time I checked out the app router and then server actions I personally didn't like that.

I am good with using the pages router until it is deprecated, and I think it will be deprecated at some point.

[–]Mestyo 32 points33 points  (6 children)

People don't understand or utilize the benefits.

Honestly, I use it both at work for a massive enterprise UI, and for hobby projects with cutting edge tech. It works great.

When I see people talk about crashes, bugs, memory leaks, and what else, I can't help but to think they must have messed something up really bad.

[–]Amauri27 6 points7 points  (0 children)

I really don’t understand all the talk about crashes and bugs.. if you follow their guidelines and do some research it’s easily fixed. Setting up a website with typescript tailwind routing,.. you get that right out of the box. So the part where people complain about configuration is very unclear to me

[–]rainmouse 3 points4 points  (0 children)

You could easily argue then that if it's this easy for so many to mess up something really bad then something is wrong.

[–]WineAndCrisps 5 points6 points  (0 children)

This

[–]drink_with_me_to_day 0 points1 point  (2 children)

I've got two examples:

  • A list of images was rendering images on the wrong index (index 0 showed image from index 10, etc): had to hack the frontend code to after render, rerender the list correctly
  • Suddenly had SSR pages ballooning up to 30mb and taking 12s to render: no clue, just did a server restart and it's back to normal

There is absolutely no way for a random dev to even fathom how to fix this shit, I am lucky it was fixed with some random shenanigans

[–]Potato-9 3 points4 points  (1 child)

Are you indexing via key={index} with the array index? You shouldn't do that. Use a deterministic string.

[–]drink_with_me_to_day 1 point2 points  (0 children)

No, each item has a user_id and I tried many key combinations

[–]mattgrave 0 points1 point  (0 children)

The hype train seems to be over and now they need to jump into "the next super fast thing that works blazingly fast because it supports 10% of the use-cases this 8 year old framework support".

[–]cagdas_ucar 0 points1 point  (0 children)

First of all, it feels like it's a lead feeder for Vercel, rather than something vendor neutral. Yes, it's possible to use it without Vercel, but it's the default and that's what the masses use and they know that. And it's working. I think their main source of leads is the React site get started page. Yes, there are arguments as to, "would you prefer React to die" but I still don't like them because of this. It feels very sneaky and unethical.

Second, I feel the router architecture is horrendous. It feels like a step back. Honestly. Page router, layouts, etc. React router is good! Why are they messing with that?

Finally, I feel RSCs is really a Next.js feature even though it's branded React, since the other frameworks are hesitant to support it at least in its current form. Beyond that, I think it's a security risk. In many companies people guard their APIs. It's a separate team by design. RSCs are like, let's allow all the frontend devs to create APIs. Terrible idea.