DEV Community

Cover image for It’s not just you, Next.js is getting harder to use

It’s not just you, Next.js is getting harder to use

Victoria on May 14, 2024

I wrote a blog post the other day about how Next.js Middleware can be useful for working around some of the restrictions imposed by server componen...
Collapse
 
calier profile image
Calie Rushton

Thanks for sharing your experience - I've just come back to learn more about Next after not using it for a while. I'm enjoying the app router on the face of it but it's really good to get perspective from someone already using it in the wild, so to speak.

I've bookmarked this article so I can come back to the details as my understanding deepens, some very interesting points here...

Collapse
 
mattlewandowski93 profile image
Matt Lewandowski

Thanks for the article.

I recently went through a lot of these pains, as I started migrating some of my pages router api routes into the app router. Vercel recently released a new utility called waitUntil, which was really useful for my app, and only works for the app router. So I thought I would migrate.

I was able to successfully migrate all of my logic, including my auth, payload, and encryption interceptors with the new architecture. I was constantly running into walls where things should have just worked, but they didn't. Like not being able to access query parameters from within a try catch.

One of my biggest pain points, was the full page re-renders when working on route handlers in dev. On the pages directory, you could modify your route handlers without causing your application to reload in dev.

Ultimately I've decided to stay away from the app directory. The DX is horrible and the amount of boilerplate files is insane. If the pages router get fully sunsetted, I would much rather just move away from NextJS. It would be a similar amount of work either way.

Collapse
 
ezpieco profile image
Ezpie

Hey I can relate this with my biggest mistake of trying to create the world's first ever open-sourced social media app... yeah just a fancy way of advertising, lambda, it's built with nextjs 14. And it's a pain to maintain

Collapse
 
jasonstitt profile image
Jason Stitt

Customers who previously loved the simplicity of it all get annoyed at how complicated things feel and… oh, look at that, a new framework has popped up that’s way simpler. We should all switch to that!

I feel this one.

I think a lot of things in frameworks have gotten strictly better over time but routing is maybe not one of them. Routing methods (file based or not) are something every framework tries a little differently and it's not clear there's an optimal solution vs. just different options.

Collapse
 
sebastianccc profile image
Sebastian Christopher

Spot on. 10/10 🙂

Collapse
 
shafqatsha profile image
Shafqat M Shah

“Why does this work… like that?”

This got me 😂🤣

Collapse
 
latobibor profile image
András Tóth

It's a well-written article! I think we are seeing next.js finding its own niche, while for other things (like writing a Dashboard or doing a mostly static page with little interactivity) we will (or already have) better tools that are less complicated.
The problem is falling in love with any tech and not looking at the big picture, not looking at alternatives. Frameworks that can stay close to their programming languages, that don't force you into their own world, are going to stay longer.
People expect to reuse their knowledge. That can only happen when your framework does not require extremely custom thinking.

Collapse
 
yaireo profile image
Yair Even Or

such poll doesn't mean much without splitting voters by years of front-end experience at least, as we do not know if most are new-comers with little experience and thus get easily confused the more a technology gets advanced.

Collapse
 
husseinkizz profile image
Hussein Kizz

Hey, what do you think about this: github.com/javaScriptKampala/z-js I started to work on it a while ago, recently released it on mpm... but I was remembering this article so am here!

Collapse
 
hiccupq profile image
hiccupq

Very true. Pain in the ass to use itt nowadays.

Collapse
 
jojomondag profile image
Josef Nobach

Interesting, I have started using SvelteKit And I must say I like it more then NextJs.

Great post keep up the good work!

Collapse
 
pozda profile image
Ivan Pozderac

I started using Astro, feeling the same way regarding NextJs.