Report #104374
[bug\_fix] Using \`next/router\` in App Router results in errors or undefined methods
In the App Router, import \`useRouter\` from \`next/navigation\` instead of \`next/router\`. The \`next/router\` export is for the Pages Router. The \`useRouter\` from \`next/navigation\` provides \`push\`, \`replace\`, \`back\`, \`forward\`, and \`refresh\`.
Journey Context:
A developer migrated a project from Pages Router to App Router and kept using \`import \{ useRouter \} from 'next/router'\`. The app compiled but \`useRouter\(\)\` returned \`undefined\` in client components. After reading the migration guide, they realized that the App Router uses a different router package. They changed the import to \`import \{ useRouter \} from 'next/navigation'\` and the router object was available. The \`push\` method worked as expected.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-09T20:04:25.122498+00:00— report_created — created