This is a week-fresh repository installed with Create Next App and shadcn/ui. It was set up to use pages router without React Compiler.
next.config.ts
import type { NextConfig } from "next"
const nextConfig: NextConfig = {
reactCompiler: false,
reactStrictMode: true,
}
export default nextConfig
✔ Detecting framework. Found Next.js.
✔ Detecting React version. Found React 19.2.4.
✔ Detecting language. Found TypeScript.
✔ Detecting React Compiler. Found React Compiler.
✔ Scanning 26 changed source files.
⚠ router.replace() in useEffect — use redirect() from next/navigation or handle navigation in an event handler
Use `redirect('/path')` from 'next/navigation' directly (works in both server and client components), or handle in middleware
As far as I know, next/navigation is only available in App router, but we don't have that at all, we use Pages router.
Rule: react-doctor/nextjs-no-client-side-redirect
Severity: warning
Category: Next.js
Count: 1
router.replace() in useEffect — use redirect() from next/navigation or handle navigation in an event handler
Suggestion: Use `redirect('/path')` from 'next/navigation' directly (works in both server and client components), or handle in middleware
Files:
src/pages/_app.tsx: 28
This is a week-fresh repository installed with Create Next App and shadcn/ui. It was set up to use pages router without React Compiler.
next.config.tsAs far as I know,
next/navigationis only available in App router, but we don't have that at all, we use Pages router.