Too Excited About the App Router? The Technical Reality
Part 2: Why running both routers side by side in a Sitecore Content SDK application gets complicated – and what Sitecore Engineering recommends instead.

A Quick Recap – and an Important Update
In Part 1, I shared how our excitement about the Next.js App Router led us to introduce it alongside the Pages Router in an existing Sitecore Content SDK application.
Next.js explicitly supports running both routers side by side during an incremental migration.
So why not take advantage of that?
Well, we've learned quite a bit since then. 😉
We've been working closely with Sitecore's technical team to investigate the challenges we encountered. And we now have a detailed assessment from Sitecore Engineering.
The recommendation is clear: Avoid running Pages Router and App Router side by side within a single Content SDK application.
The current SDK APIs and templates are designed around a single router setup. Supporting both simultaneously requires considerable custom integration work and introduces unnecessary complexity.
Sitecore Engineering recommends preparing the migration while still using the Pages Router, then ideally switching the application to the App Router in one coordinated step.
The formal support status of the mixed-router approach is still being reviewed, so I won't label it officially unsupported.
But based on the technical findings and recommendation, it's not an architecture I would recommend adopting.
So what exactly makes it so complicated?
Let's take a closer look.
Why Running Both Routers Gets Complicated
The challenge isn't simply that Next.js has two different routing mechanisms.
The Sitecore Content SDK provides additional functionality built around those mechanisms: multisite routing, localization, component registration, editing, and more.
And the current SDK templates configure these integrations for one router at a time.
According to Sitecore Engineering, a Content SDK application is designed around one configuration, one Sitecore client, one generated Component Map, one proxy chain, one localization strategy, and one set of editing endpoints.
Running both routers means introducing custom logic to coordinate these mechanisms.
Here are the main challenges we encountered and what we learned during the investigation.
1. Proxy and Multisite Routing
Next.js allows only one proxy.ts entry point per application.
But the Content SDK uses different proxy implementations depending on the router:
- Pages Router:
MultisiteProxy - App Router:
LocaleProxyandAppRouterMultisiteProxy
These implementations handle URL rewriting and locale resolution differently.
To run both routers, we needed custom route detection to determine which proxy logic should apply to each request.
In our case, that meant introducing additional matching rules and adjustments.
The problem?
Such rules can become fragile, particularly in a multisite, multilingual application with many different URL patterns.
Sitecore Engineering confirmed that this is a fundamental integration challenge of the mixed-router architecture.
Takeaway: Rather than maintaining custom logic to coordinate two proxy implementations, prepare the existing proxy configuration for a clean transition to the App Router setup.
2. Localization – next-localization vs. next-intl
This was one of our most visible problem areas.
The Content SDK Pages Router implementation uses next-localization, while the App Router implementation uses next-intl.
Both handle localization, but they don't resolve locale information in exactly the same way.
In our application, this resulted in issues such as:
- Redirects containing
/undefined/instead of a valid locale. - Duplicated locale segments in canonical URLs.
- Unexpected language redirects.
We introduced adjustments to locale handling and redirect generation to address these issues.
Sitecore Engineering confirmed that the different localization strategies explain the behavior we observed.
Takeaway: Avoid maintaining two competing locale strategies within one application. Follow the Content SDK migration guidance when moving from next-localization to next-intl.
3. Component Maps and React Server Components
This is where things become particularly interesting for regular Sitecore component development.
The Content SDK's App Router implementation supports both Server and Client Components, while the Pages Router relies on components compatible with its traditional rendering model.
The generated Content SDK Component Map reflects these differences.
In a mixed-router application, that creates a problem: the generated map may contain Server Components that the Pages Router cannot render.
We encountered this with existing components and integrations, including Sitecore Forms.
Our solution was to introduce a wrapper that provides client-compatible component implementations when rendering through the Pages Router.
Sitecore Engineering confirmed that such a wrapper is necessary for our mixed-router setup.
But needing to maintain that compatibility layer is also a good example of the additional complexity we're introducing.
And this isn't limited to Forms, BYOC, or FEAAS.
It affects the general architecture for rendering Sitecore components.
Takeaway: Follow the Content SDK's App Router component registration approach, keeping Server and Client Components appropriately separated, instead of maintaining a compatibility layer for both routers.
4. Navigation Between Routers
Another interesting issue involved next/link.
When navigating from a Pages Router page to an App Router route, we encountered requests to non-existent /_next/data/ endpoints, resulting in 404 responses.
Sitecore Engineering identified this as a Next.js limitation in our scenario and confirmed the appropriate workaround:
Use regular HTML <a> links when navigating across the router boundary.
This triggers a full browser navigation rather than relying on client-side routing across the two implementations.
Next.js itself documents that navigation between the routers involves a hard navigation.
So the workaround is relatively straightforward.
But it's another special case that needs to be considered, implemented, and tested throughout the application.
Takeaway: If you temporarily operate both routers, navigation across the boundary needs special attention. For a full migration, eliminate that boundary rather than maintaining permanent workarounds.
5. Editing and API Endpoints
This is an important area we hadn't fully considered when introducing the App Router.
The Content SDK uses different editing mechanisms for each router:
- Pages Router:
EditingRenderMiddlewareand Next.js Preview Mode. - App Router:
createEditingRenderRouteHandlersand Draft Mode with additional request information.
Both implementations need to obtain editing data differently.
Consequently, a single /api/editing/render endpoint cannot handle both approaches without additional custom logic.
Sitecore Engineering also pointed out that the App Router starter does not provide the same FEAAS render endpoints as the Pages Router starter.
Not all API routes have this problem.
Generic routes such as sitemap, robots, or configuration endpoints can be migrated independently.
Takeaway: Editing is a core part of the SDK architecture, not just another API route. It needs to be migrated as part of the coordinated router switch.
So, What's the Recommended Migration Strategy?
Fortunately, avoiding a mixed-router architecture doesn't mean all migration work has to happen at once.
That's probably the most useful insight from the Engineering discussion.
You can prepare incrementally without running both routing models in production.
Sitecore Engineering identified several changes that can be made while the application is still running on Pages Router.
What You Can Prepare in Advance
1. Identify Client Components
Add 'use client' to components that require hooks, state, context, or browser APIs.
The Pages Router ignores this directive, so these changes can be prepared ahead of the migration.
2. Prepare Navigation APIs
Review dependencies on next/router and prepare the transition to next/navigation.
Sitecore Engineering recommends adopting compatible navigation hooks in advance where possible.
3. Keep Components Router-Agnostic
Remove Pages-Router-specific dependencies from reusable components.
For example, avoid relying directly on next/head or page-level data-fetching contexts inside shared components.
Keep server-only functionality separate.
4. Abstract Localization
Instead of using next-localization directly throughout the application, introduce a small abstraction.
That way, the switch to next-intl can be handled in a more controlled way.
5. Migrate Simple API Routes
Some API routes can already move to App Router route handlers, including sitemap, robots, and similar endpoints.
Just remember: the same URL path must not exist in both pages/api and app/api.
6. Simplify Custom Proxy Logic
Review existing redirects, locale handling, and custom routing rules.
The less custom logic you need to carry over, the easier the final migration becomes.
What Should Be Migrated Together?
Once the application is ready, the remaining router-specific infrastructure should be switched together.
That includes the catch-all page, application layout, error handling, component rendering, editing endpoints, proxy configuration, and the final localization setup.
For the implementation details, I strongly recommend following Sitecore's official guide:
Migrate your Content SDK 1.3.1 Pages Router app to App Router
The guide walks through the required changes and recommends creating an App Router starter application as a reference for the migration.
There's no need to reinvent those instructions here. 😉
Final Thoughts
Looking back, the technical challenges make a lot more sense now.
We weren't simply introducing a new routing mechanism.
We were trying to make two different Sitecore Content SDK application architectures coexist within one application.
And that required more custom integration work than we initially expected.
I'm grateful to the Sitecore team for taking the time to investigate our implementation and explain the architectural differences in detail.
My biggest takeaway from this second part?
Incremental preparation is absolutely possible.
But incremental preparation doesn't necessarily mean running both routers side by side.
For a Content SDK application, a coordinated migration is the approach Sitecore Engineering currently recommends.
The formal support assessment is still ongoing, and I'll share any relevant updates once we have them.
In the meantime, I'd love to hear from other Sitecore developers:
Have you already migrated an enterprise Content SDK application to the App Router? What challenges did you encounter, and how did you approach the transition?
Always happy to learn from the community! 😉
Comments
Join the discussionNo comments yet. Be the first to comment.





