Wednesday, October 28, 2026

thumbnail

Next.js 16, one year on: what broke when I upgraded a real site

Next.js 16, one year on: what broke when I upgraded a real site

Posted on Oct 28 • Originally published at kunjdeveloper.com

Next.js 16 came out in October 2025. A year later it is the version most new projects start on, and the version a lot of working sites still have not moved to. This site moved this month. It is a real app, not a starter: the App Router, a Postgres database through TypeORM, a credentials-based admin panel, and a Docker image that runs on a small VPS.

The official upgrade guide is good and the codemod does most of the typing. What the guide cannot tell you is which of its changes will hit your particular stack. Two problems broke this site's production build in ways a dev server never showed. This is what broke, why, and what I would check before you upgrade yours.

The headline change is that next build uses Turbopack by default. Development already did; now production does too. For most code that is invisible. For code that relies on two routes sharing the same instance of a module, it is not.

After the upgrade, the production build served every public page fine, and admin sign-in failed with this:

The cause is how the database connection and the bundles meet. The TypeORM DataSource is created once and shared through globalThis, so whichever route connects first registers its entity classes. Turbopack gives each route its own copy of those classes. In production the first request is usually a public page, so the connection held the public page's Admin class, and the auth route asked for a repository with its own, different Admin class. TypeORM compares classes by identity, so as far as it was concerned that entity had never been registered.


📅 Published Date: Wed, 28 Oct 2026 10:18:32 +0000
🔗 Original Source: Read on original site

Subscribe by Email

Follow Updates Articles from This Blog via Email

No Comments

About