nextjs - 💡(How to fix) Fix Page Router Projects to Next.js 14+ Issue [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#86903Fetched 2026-04-08 02:08:26
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×2closed ×1commented ×1issue_type_added ×1

Error Message

Error Handling

Fix Action

Fix / Workaround

Attempt upgrade to Next.js 14.2.5 following official guide

Code Example

Repository: https://github.com/fecommunity/reactpress

Pages: 200+ documentation pages

Key Features: SSG, i18n, advanced routing, custom docs structure

Current Next.js: 12.3.4Target: 14.2.5+
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/fecommunity/reactpress/client

To Reproduce

Clone ReactPress: git clone https://github.com/fecommunity/reactpress

Current version: Next.js 12.3.4 with Page Router

Attempt upgrade to Next.js 14.2.5 following official guide

Observe multiple warnings and broken functionality in:

Dynamic routes with getStaticPaths

Custom _app.js and _document.js configurations

API routes using Page Router structure

Current vs. Expected behavior

Official backward compatibility for Page Router through Next.js 15

Automated codemods for common Page Router patterns

Hybrid routing documentation for gradual migration

Provide environment information

Repository: https://github.com/fecommunity/reactpress

Pages: 200+ documentation pages

Key Features: SSG, i18n, advanced routing, custom docs structure

Current Next.js: 12.3.4 → Target: 14.2.5+

Which area(s) are affected? (Select all that apply)

Error Handling

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

// Current ReactPress page structure (needs migration clarity): // pages/docs/[[...slug]].js export async function getStaticPaths() { // Complex i18n + documentation path generation }

export async function getStaticProps({ params, locale }) { // MDX content loading with i18n }

export default function DocPage({ content, toc }) { // Page Router component - how to migrate to App Router? }

❌ Manual page-by-page migration (too time-consuming)

❌ Using next-compat plugins (incomplete solution)

⏳ Partial App Router adoption (breaks shared layouts/state)

extent analysis

TL;DR

Migrate from Page Router to App Router in Next.js by updating getStaticPaths and getStaticProps to use the new routing API, and refactor custom _app.js and _document.js configurations.

Guidance

  • Review the official Next.js documentation on migrating from Page Router to App Router, focusing on hybrid routing and automated codemods for common patterns.
  • Update getStaticPaths and getStaticProps in pages/docs/[[...slug]].js to use the new App Router API, considering the complex i18n and documentation path generation.
  • Refactor custom _app.js and _document.js configurations to be compatible with App Router, ensuring shared layouts and state management work as expected.
  • Consider a gradual migration approach, starting with a small subset of pages to test and validate the changes before applying them to the entire project.

Example

// pages/docs/[[...slug]].js (updated for App Router)
export async function generateStaticParams() {
  // Complex i18n + documentation path generation
}

export async function generateStaticProps({ params, locale }) {
  // MDX content loading with i18n
}

export default function DocPage({ content, toc }) {
  // Refactored Page Router component for App Router
}

Notes

The migration from Page Router to App Router requires careful consideration of the project's specific requirements, such as i18n and custom documentation structures. The official Next.js documentation and automated codemods should be consulted to ensure a smooth transition.

Recommendation

Apply a gradual migration workaround, starting with a small subset of pages, to test and validate the changes before applying them to the entire project. This approach will help minimize disruptions and ensure a stable transition to App Router.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING