Things about Next.js that drive me insane

Similarly to my post about Bun, I want to start a list about Next.js things that drive me insane. I love the page rendering, SSR and static generation of React that give Next.js great performance boost.

Unfortunately, Next.js falls short in almost all aspects of a web framework that I would expect. As a backend developer that uses MVC frameworks a lot (especially Symfony), I have a lot of problems with Next.js. Here is a non-complete list in no particular order. I will try to update this post as time goes on.

  • Sitemap generation does not generate a sitemap index, making it pretty useless
  • No built-in auth layer
  • No built-in i18n layer
  • No built-in event system
    • Makes integration of an ecosystem unnecessarily hard. Look at Symfony’s bundles and event system which is very plug and play. Symfony lets you add 2FA authentication with one composer command. Next.js couldn’t even dream of that.
  • Getting the current request outside of a server component or endpoint file is near-impossible
    • This makes building a custom auth or event layer even harder. These are things you can’t build in one file and you are forced to pass the request to every function that needs it manually. A global would fix this. Symfony does this with dependency injection.
  • You only get one middleware
    • This one sucks a lot, because a lot of features like auth and i18n that come built-in with other frameworks rely on a middleware. You need one for auth and one for i18n, yet Next.js only lets you have one. You need to combine them and there’s no proper way to do that. On top of that, the concept of middleware and weird regex-ing you have to do for it is horrible on its own.
  • Random, unreadable and undebuggable errors
  • Almost no dev tools or profiling
  • React 19 broke next/link
    • Found nothing about this online, but updating to React 19 completely broke this component for me. Downgrading to React 18 fixed it.
  • No built-in form handling
    • Need to rely on third party stuff for something so basic

This list, together with the list of problems with Bun, shows to me how the JavaScript ecosystem vastly prefers new and shiny innovations over any sort of support and stability. If I had the time and money, I would probably just build my own framework.

Things about Bun that drive me insane

A while ago, I started using Bun instead of Node.js, because of a lot of DX improvements. Not having to worry about TypeScript files or ESM support is really good. Unfortunately, bun has a lot of edge cases with no solutions, that make using it a nightmare. I intend to collect these things in this article over time.

Since I have already committed to using Bun in production, I can’t simply switch back to Node.js now. But it is important to keep these things in mind, when making your decision. At the time of writing this article, Deno 2.0 looks much more promising than Bun. And while Node.js has a lot of annoying quirks, it is certainly much more stable than Bun.

Debugging “Temporary failure in name resolution” in Docker containers

I was encountering DNS issues with Docker containers orchestrated by DDEV earlier. Some hosts failed to resolve only within the container for some reason.

To fix it, I changed the following options in the `/etc/default/docker` file:

DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

This helps override the DNS options for Docker containers. Afterwards restart the Docker service:

sudo service docker restart

This solved the problem for me. I found the solution on Stackoverflow.

GitHub Outage

Today I may have killed GitHub. Not really but it’s a funny coincidence.

I was working on something and after I committed my changes and pushing I noticed that the dev branch was ahead of my feature branch and there were now some merge conflicts.

I quickly rebased my feature branch but when trying to push the changes all of a sudden I got the following message:

“Weird”, I thought. I have gotten my pushes rejected before but not with this ominous “Internal Server Error” message. I thought I messed up something and GitHub couldn’t process my changes.

So I thought around and tried some other things, even reverting the other changes to force my rebase but nothing worked. I googled around and couldn’t quite find any answer until I took to everybody’s least favorite social media platform Twitter, saw that “GitHub” was trending and found this tweet. It wasn’t just me and GitHub had a partial outage.

How weird of a coincidence it is that this happens just as I want to push something. Today was also the day I moved a project with a full CI/CD pipeline to GitHub Actions for the first time. The stars just aligned, I guess.

Fix for WSL2 docker-credential-desktop.exe: Invalid argument

I just ran into a weird error with WSL after moving a workspace around on a different machine and trying to run ddev.

failed to solve with frontend dockerfile.v0: failed to build LLB: failed to load cache key: rpc error: code = Unknown desc = error getting credentials - err: exec: “docker-credential-desktop.exe”: executable file not found in $PATH, out: ``

When trying to invoke the “docker-credential-desktop.exe” from WSL (by building a Docker image or trying to run ddev for example) I always got a “Invalid argument” error. After a bit of trying around I found this message on the Docker forums which actually fixed the problem for me.

Edit the ~/.docker/config.json file:

nano ~/.docker/config.json

It should display something similar to this:

{
  "credsStore": "desktop.exe"
}

Change “credsStore” to “credStore” like this:

{
  "credStore": "desktop.exe"
}

I have no idea why this works or why this is a thing, but I would like to preserve this solution here in case it happens to me again or somebody else runs into this same problem.

I was able to run ddev normally afterwards.