{
  "id": 23707982,
  "title": "How to migrate from nextjs-mf to the Next.js App Router",
  "url": "https://urgent.news/2026/12/05/how-to-migrate-from-nextjs-mf-to-the-next-js-app-router",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-12-05T21:57:32.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/thk101/how-to-migrate-from-nextjs-mf-to-the-nextjs-app-router-27d3"
  },
  "original_language": null,
  "account": "To move from the Next.js Monorepo Federation to the Next.js App Router, begin by isolating the UI components and moving them to remote build servers. Use the old plugin's exposes to list the exposed UI, its imports, and the shared modules. Create a Vite remote project and list the remote UI component with its amount prop. Configure the remote in vite.config.ts with the base URL and exposes. Remove React Fast Refresh from the remote config and serve the output. Test that the remote responds correctly using nf-serve. Next, update the host integration on an existing Pages Router route within a staging environment. This requires upgrading to Next.js 16 with React 19 and preparing replacements for any remaining remotes. Then, replace the old import path with the createRemoteComponent wrapper. This allows the route to render the remote component with loading and error fallbacks. Finally, create an App Router wrapper for the same remote component, maintaining the same expose and props. This ensures the remote component can be rendered from an App Router page, preserving functionality while transitioning to the new router architecture.",
  "summary": "If @module-federation/nextjs-mf is the reason your app is still on the Pages Router, you can move the federation integration first and move routes afterward. I built Next Federation to make that possible. It supports both Next.js routers with Turbopack or webpack on the host. The old plugin's docs mark the integration as deprecated and list Pages Router support. Upstream integration docs Here's…",
  "summary_source": "publisher",
  "key_points": [
    "Isolate UI components and move to remote build servers",
    "Create Vite remote project with exposed UI components",
    "Replace old import paths with createRemoteComponent wrapper"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "outlets_capped": false,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}