DEV Community

Why I'm not using Next.js

Jack on July 05, 2021

So I'm building an application. Not only am I using react, but I'm also using node. Surely I'm using next.js right? I mean, every other article I s...
Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

But what about jobs, so many next.js jobs, Im having a much better time in svelte-kit, such a dilemma.

Collapse
 
jackmellis profile image
Jack

Agreed. This underpins most of my tech decisions sadly. I use Next, React, Redux, because that’s where the work is. But if it was up to me I’d be writing Vue

Collapse
 
nickelghost profile image
Gabriel Karczewski

Oh wow, this reflects my thoughts so much that I created an account on dev.to just to thank you and comment on this post!
At the project I'm currently leading, we have two front-end apps - one uses Next.js and another that uses CRA. I've recently noticed how much time I'm spending on working out weird quirks instead of working on the app with the one that uses Next.
I had an issue with how it handled ENVs - depending on a few conditions, it wouldn't load them and instead depend on the build-time values, which wouldn't exist if I didn't bake them into our Docker images. I've filed a bug report and apparently it's been fixed, but it just shows how many edge cases there can be - in this case, the problem only appeared when navigating from an ASO/SSG page to an SSR page, and the 404 page can't be SSR so I had to go for baking the ENVs into images.
Recently, I upgraded the Next.js version we're using and some optimisation started messing with my fonts - either wrong ones were computed, or the fonts didn't load and the browser used a fallback. Turning off the font optimisation in the config file didn't work. It appears that Next expects the font stylesheets to only be referenced in a custom document, I couldn't use @import in my CSS files anymore. Oh, and this only appeared in production builds.
Next is a really cool project that does a lot of things right, could be the ultimate way to create web apps someday, but currently it's too ambitious and too messy. I want to recreate a page or two of that app using Vite CSR and Go templates SSR (separately) to see how the alternatives would perform.
Thanks again for the post! We need a healthy dose of scepticism in the programming community.

Collapse
 
gus1 profile image
Gus • Edited

I think your definition of opinionated differs greatly from the standard. Also Next + Vercel offer way too much benefits that heavily outweigh most of your concerns. On top of this your concerns are rather weak. With all due respect but have you really worked with Next and do you really understand it's purpose and foundations?

Collapse
 
jackmellis profile image
Jack

Oh boy just wait until I write up why I'm not using react query 🀣🀣

I did try to stress that this is just my subjective opinion. Yes I use next every day at work and honestly it causes more headaches for the team than when we weren't using it.

We're all entitled to our opinions right? But for me, next is just too opinionated. I would probably say the same of most frameworks that hide the build process and routing logic from me. I like to be in control...

Collapse
 
gus1 profile image
Gus

Might as well just go full JS vanilla mode.

Thread Thread
 
jackmellis profile image
Jack

Yeah or maybe just use punch cards, or we could write everything on paper and serve the internet via post

Thread Thread
 
gus1 profile image
Gus

πŸ™‚

Thread Thread
 
ozzy432836 profile image
Oz • Edited

If you think the only option besides Next is Vanilla JS or punch cards then you really are narrow minded. There are some people that don't see exclusive value in Next and I am one of them.

Next gives you

  • a new way to request HTML from a web server
  • React's method of managing the DOM
  • ajax page loading
  • faster loading web site pages

These are not exclusive to Next and you can get round those using other tech and using React as a library on top of some other CMS or MVC Framework for the SEO parts of my app.

Collapse
 
vladi160 profile image
vladi160

Actually it's just a React. Getinitialprops is deprecated. Getserver/static. Nothing opinionated here. Try Rails to see what is opinionated ;) . You can change the API route or/and use custom server. The server side things are only for the first request and this is awesome, but what, how, when, why will run depends on you.

Collapse
 
alukaszew profile image
Adam

In Next13 i was like wtf man? So much good stuff but behind that stuff you will see much of useless stuff... Why to push developer to use specific way of building routes? Why those strange file and dir names, like (YoutDirName) for kipping the code, you don't want to have public but you doing something with it. In documentation you have this "Marketing" example xD. What "Marketing files" do you have in your repository? In professional apps, you can't have something like that in your codebase because it is a trash... For me, It's nice to look at Next13 but it transformed to hyped marketing product.

Collapse
 
amani_art profile image
Austine Amani

Pretty weak points.

Collapse
 
jackmellis profile image
Jack

I'm not trying to convince the world not to use next. I just wanted to cover the factors that mattered to me personally

Collapse
 
aidenybai profile image
Aiden Bai

Yeah, and additionally this comment provides no constructive feedback. What's weak about it?

Collapse
 
jackmellis profile image
Jack

Yes I have been using vite and I've really enjoyed it!

Collapse
 
shapkar profile image
Naum Shapkarovski • Edited

Have you tried Vite with react-ts and SSR? Is it better than nextjs? And is it safe to start a large project with? Thank you!

Collapse
 
ivan_jrmc profile image
Ivan Jeremic • Edited

Not a UI Framework is telling you where your Api routes should live Nextjs as an Application framework tells you that.

Collapse
 
jackmellis profile image
Jack

Next is almost entirely concerned with react, there isn't really much in the way of framework stuff for the backend side, besides the routing. Maybe it's described as an application framework but the emphasis is on the ui.