Skip to content

React Compiler wrongly detected, next.js router wrongly detected #126

@ackvf

Description

@ackvf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions