Report #103726
[bug\_fix] Error: 'useRouter' is not exported from 'next/router' in Next.js 13\+ App Router
Use \`import \{ useRouter \} from 'next/navigation'\` instead of \`next/router\` when using the App Router. The root cause is that Next.js 13 introduced a new router for the App Router \(\`next/navigation\`\) that is separate from the Pages Router \(\`next/router\`\). The established fix is to import from the correct module based on your routing paradigm.
Journey Context:
I was upgrading a Next.js 12 app to Next.js 13 and migrating pages to the App Router. I had a component that used \`useRouter\` from \`next/router\` to programmatically navigate. After moving the component into the \`app/\` directory, I got the error: 'Module not found: Can't resolve 'next/router''. I spent an hour checking my \`next.config.js\` and reinstalling node\_modules. The real issue was that the App Router uses a completely different router module. The fix was to change the import to \`import \{ useRouter \} from 'next/navigation'\`. The API is slightly different \(e.g., \`router.push\` works the same, but \`router.query\` is replaced by \`useSearchParams\`\). This is a well-documented breaking change in the Next.js 13 migration guide.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-12T20:08:36.385553+00:00— report_created — created