Migrating a Lovable App to Next.js 16: A Phase-by-Phase Walkthrough
Most Lovable-to-Next.js advice was written for Next.js 15. Start the migration today and you land on the 16.3 line, where the compatibility shims that made 15 forgiving are gone. Here is the walkthrough, phase by phase.
New to this? Start with our guide: how to migrate a Lovable app to Next.js without breaking it.
A Lovable to Next.js migration is usually scoped as a rendering problem: the app is a single-page app, search engines struggle with it, so move it onto a framework that renders on the server. That part is true. What catches teams out is the version they land on. Almost every migration guide still in circulation was written against Next.js 15, and Next.js 15 was deliberately forgiving. Next.js 16 is not.
The version you land on is not the version the guides describe
Next.js 16 shipped on 21 October 2025. Next.js 16.2 followed on 18 March 2026 and 16.3 on 3 August 2026. The official version 16 upgrade guide now carries the version number 16.3.5 and was last updated on 25 August 2026, so a migration started this week lands on the 16.3 line by default.
The most important consequence sits in one sentence of that guide. Next.js 15 introduced asynchronous request APIs but kept synchronous access working as a temporary compatibility measure. In 16, per the guide, "synchronous access is fully removed." Every params, searchParams, cookies(), headers() and draftMode() call has to be awaited. Code that a Next.js 15 tutorial told you was fine will not build.
Phase 1 - get the code out of Lovable before you touch anything
Do this first, because it changes how everything after it gets reviewed. Lovable's Git integration is bidirectional: "Changes made in Lovable sync to GitHub" and "Changes pushed to the active GitHub branch sync back into Lovable." Connecting a project creates a repository, and if you later disconnect, "Your repository stays on GitHub." You own the code either way.
The detail that bites is that Lovable syncs one branch at a time. Commits on other branches do not appear until you merge them or point Lovable at that branch. Run a migration on a long-lived side branch while someone keeps prompting in Lovable, and you will spend a day reconciling two versions of the same file. Freeze the Lovable branch for the duration, or accept that the migration branch is now the source of truth. If your team is on Bitbucket rather than GitHub, bidirectional Bitbucket Cloud sync was added on 10 September 2026.
Phase 2 - choose the target line before you write a line of code
| Decision point | Next.js 16.3 | Next.js 15.5 |
|---|---|---|
| Release status | Active LTS | Maintenance LTS |
| Patched release from the 25 August 2026 security release | 16.3.3 | 15.5.24 |
| Synchronous params, cookies, headers | Removed, must be awaited | Still available from the 15 compatibility period |
| Default bundler | Turbopack | Webpack, Turbopack opt-in |
| Request interception file | proxy.ts, Node.js runtime only | middleware.ts |
| next lint | Removed, run ESLint or Biome directly | Available |
| Where new feature work belongs | Here, unless something blocks you | Only while that blocker exists |
Both lines are supported. Pick 15.5 only if a specific dependency or hosting constraint forces it, and write down what that constraint is, because it becomes the thing you have to remove later. For most Lovable apps, which carry few exotic dependencies and no webpack history to defend, 16.3 is the cheaper long-term target.
Phase 3 - the breaking changes that actually consume the budget
Run the upgrade codemod first: npx @next/codemod@canary upgrade latest. It moves next.config to the new top-level turbopack key, migrates next lint to the ESLint CLI, renames the middleware convention to proxy, strips unstable_ prefixes from stabilised APIs, and removes the experimental_ppr route segment config. It does not handle the async request APIs, so run npx @next/codemod@canary next-async-request-api . as well.
What the codemods leave behind is the list worth budgeting for. The middleware file becomes proxy.ts and the exported function is renamed with it; the edge runtime is not supported in proxy, whose runtime is Node.js and cannot be configured. Every parallel route slot now needs an explicit default.js file, and builds fail without them. If the project has a custom webpack config, next build now fails outright to prevent a misconfiguration, and you choose between migrating the config, building with Turbopack anyway, or passing the webpack flag.
Then there is next/image, which is where a Lovable app quietly changes appearance. The default minimumCacheTTL moved from 60 seconds to 4 hours. The default qualities list moved from every value to just 75, and a quality prop outside the list is coerced to the closest allowed value, so a quality of 90 silently becomes 75. The value 16 was dropped from the default imageSizes array, maximumRedirects went from unlimited to 3, and local IP optimisation is blocked by default behind a dangerouslyAllowLocalIP flag. None of these break the build. They change output, which is worse, because nobody is looking.
Caching changed shape too. revalidateTag now requires a cacheLife profile as its second argument, and the single-argument form is deprecated and produces a TypeScript error. A new Server-Actions-only updateTag gives read-your-writes semantics for the cases where a user must see their own change immediately. serverRuntimeConfig and publicRuntimeConfig are gone entirely, replaced by environment variables. The baseline moved as well: Node.js 20.9 or later, TypeScript 5.1 or later.
Phase 4 - the database does not migrate itself
Moving the front end does not touch your Supabase policies, and a migration is exactly the moment people assume it did. Supabase's own guidance is unambiguous: "A table in an exposed schema without RLS is readable and writable by any role with a grant on it," and "Enable RLS on every table in an exposed schema. On projects that still grant anon and authenticated by default, revoke those grants." Adding policies does not remove existing grants.
What genuinely does change is that you now have a server in front of the database, so some queries move server-side and the question of which key is used where has a new answer. That is a gain in control and a fresh opportunity to get the policy model wrong. Audit it as its own phase, not as a footnote to the front-end work.
Phase 5 - plan the first patch before you launch
A migration is a starting point, not a finish line. On 25 August 2026 Next.js shipped a security release addressing two critical-severity vulnerabilities, with fixes "available in v16.3.3 (Active LTS) and v15.5.24 (Maintenance LTS)." One was unauthenticated remote code execution through the Image Optimization API when optimising an attacker-controlled AVIF image; the patched releases disable AVIF optimisation until the upstream fix propagates. The other affected servers on a Windows filesystem using both routers without Cache Components, where the advisory states plainly that "There is no known workaround for affected Windows-hosted applications" and that "Linux and macOS are not affected."
Whoever owns the app after launch needs a route to apply a patch release within days, not quarters. If the answer is "the agency that built it, if they reply," that is the gap to close before you ship, not after.
What this costs
If you want the target line, the breaking-change inventory and a realistic sequence written down before anyone commits code, our Strategy Audit is $499 one-time and is credited toward any build. If the honest answer is that the app should be rebuilt rather than ported, the Publishable MVP package is $4,999 one-time, and the Founding Client package is $2,999 one-time with a 14-day build guarantee and a full refund if the deadline is missed. Every build carries the same promise: first paying customers within 90 days of launch, or a full refund. We have completed 80 jobs on Upwork on this stack.
If we are not the right fit, we will say so on the call.
Sources
- https://nextjs.org/blog/next-16
- https://nextjs.org/docs/app/guides/upgrading/version-16
- https://nextjs.org/blog/next-16-3
- https://nextjs.org/blog/august-2026-security-release
- https://docs.lovable.dev/integrations/git-integration
- https://docs.lovable.dev/changelog
- https://supabase.com/docs/guides/database/postgres/row-level-security