Live data from Hacker News

Next.js is infuriating

blog.meca.sh

231–240 of 602 posts

Re: Next.js is infuriating

#231
post #107

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.

Many of the abstractions and nextjs tools do things that my OS does better, cleaner and more predictable too. I suppose the overly complicated ENV/.env loading hierarchy is (partly) needed because Windows doesn't (didn't?) have ENV vars. Same for inotify, port detection, thread management: *nix does it well, consistent ish. But when you want an interface or feature that works on both *nix and windows, in the same way…

> because Windows doesn't (didn't?) have ENV vars.

As long as I can remember in my career, Windows had environment variables. So that's at least 25 years. It's both available to view/edit in the GUI and at the prompt.

Re: Next.js is infuriating

#232
post #211

I’ve always felt that Vercel’s way has had fundamental flaws at its core “philosophy” and their approach to creating shiny objects from outside that stink from inside. Unfortunately incompetence of developers to see beyond has brought the web to the point that every React developer has dealt with Nextjs at some point. What are the alternatives beyond Vite and Remix?

Solid and sveltekit

Re: Next.js is infuriating

#233
post #76

> SvelteKit is a Vercel product While Vercel acqui-hired many developers behind SvelteKit and Nuxt.js, I was under the impression that they weren't interested in running these projects hands-on, or even making them similar to each other. Can anyone correct me here or explain what their long-term game seems to be?

Rich Harris answered this question on Reddit a year ago: https://www.reddit.com/r/sveltejs/comments/19ac6lp/concern_a... Seems Svelte is still mostly managed as an independent open source project.

I came here exactly for this. Vercel has long since passed the investment threshold where they are driven by building cool things. Now they are surely driven by project managers managing PKIs. I love Svelte and I'm sure Rich Harris has been in meetings where someone said to him "Sure, I know that's important, but this feature I'm talking about will bump my numbers next quarter..." And, that's the slippery slope.

Re: Next.js is infuriating

#234
post #190

I think “middleware” is a bit of a misnomer in Next.js. It’s really an edge function that runs before your request hits the app -- quick header checks, routing, and other lightweight guards. It runs on the edge runtime, not on the app server. The post's author seems to conflate the edge runtime with the server runtime. They’re separate environments with different constraints and trade-offs. I struggled with Next.js a…

> But blaming Next.js for that complexity is like blaming a toolbox for having more than a hammer.

The biggest issue is that the complexity is self-inflicted. The term middleware has a pretty well understood meaning if you've worked with basically any other framework in any language: it's a function or list of functions that are called at runtime before the request handler, and it is assumed those functions run in the same process. The fact that Next.js puts it on the edge and only allows one is breaking that assumption, and further, most applications do not need the additional complexity. To go back to your toolbox analogy, more tools mean more complexity (and money), so you wouldn't get a new tool simply because you might need it, you get it because you do need it, and the same applies to edge functionality. If Next.js wants to allow you to run code on the edge before your app is called, that's fine, but it should be opt-in, so you don't need to worry about it when you don't need it, and it shouldn't be called "middleware".

Re: Next.js is infuriating

#235
post #85

Earlier quoted context omitted.

In my opinion (9 years FE exp) you should build your ecommerce site in shopify or wordpress + woocommerce or some other off the shelf tool. It will be up before the evening's out and you won't be spending that much extra than you would have anyway, and everything will Just Work (tm) and look pretty good (chuck out 50$ for a nice wordpress theme and you're golden). If you insist on rolling your own, Django + templates…

No! PHP is merely bad, but Wordpress is truly abysmal. Steer clear. Webdev since 1998 (27y).

Well, fine, what would you recommend instead? I've never had issues with wordpress as long as I stay away from their stupid block editor thingy but you've much more experience than me so I'm curious your opinion.

Re: Next.js is infuriating

#236
As an experienced dev who has explored almost all possible JS options - including but not limited to - React, Angular, etc. and settled for Phoenix/Elixir, I can tell you nothing comes close to the peace of mind you get from just opening up a text editor, naming a module whatever the fuck you like, writing functions, piping the results, validating with `with..do..else` and the best part - catching errors at compile time. Everything just works - even after 5 years. Whereas, with JS, something keeps getting burned down every 6 months or less even if you didn't touch the code at all.

Seriously, give Elixir a shot.

Re: Next.js is infuriating

#238
post #55

Deno Fresh seems like it has the right approach. It’s not complicated, the docs are refreshingly simple, and it handles both server and client logic without getting confused. It’s just a shame it’s Deno-only (although I completely understand why)

I had a project slated to use this framework. The pilot went fairly well. Fresh has the right ideas on static vs dynamic islands. In the end, we deployed with Astro - which also has similar ideas. In the end, I just wasn't able to get full buy-in on Deno.

That’s a shame, I’ve also been through much the same process.

Astro is pretty good too, though. I’m not 100% sure on some of the decisions it’s made, and personally don’t enjoy the need for new file formats and domain specific languages, but it does a half decent job of being framework-agnostic despite a few pain points.

Re: Next.js is infuriating

#239

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.

Yes, and even if you manage to work around its profoundly silly limitations—seriously who designed the new routing nonsense and have they ever made a website before—every time you go to upgrade the new version breaks everything.

By comparison, DIY SSR with Express takes a few days to get working and has run quietly for multiple projects for years on end.

Re: Next.js is infuriating

#240

Earlier quoted context omitted.

My experience with Next.js are that its rough edges are a feature, not a bug. Everything is geared towards you giving up and just using Vercel's hosting

Which is why I actually love sveltekit considering that its really easy to self host it / host it anywhere serverless. I hosted it on cloudflare. Though I do feel that everyone is pushing nextjs in the llm space and llm's are more comfortable with next instead of sveltekit but they can still do some mind boggling things in sveltekit and I love them while using sveltekit itself

Svelte is financed by vercel, so who knows if sveltekit drifts in the same direction.
Post reply on HN