Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reactStrictMode is not effect in nextjs v15.x, but it's work in nextjs v14 #74977

Open
1 task done
takeseem opened this issue Jan 16, 2025 · 0 comments
Open
1 task done

Comments

@takeseem
Copy link

takeseem commented Jan 16, 2025

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Node.js v23.6.0

Operating System:
  Platform: linux
  Arch: x64
  Version: #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec  5 13:09:44 UTC 2024
  Available memory (MB): 92316
  Available CPU cores: 16
Binaries:
  Node: 23.6.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 9.15.4
Relevant Packages:
  next: 15.2.0-canary.12 // Latest available version is detected (15.2.0-canary.12).
  eslint-config-next: 14.2.23
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.7.3
Next.js Config:
  output: N/A

Which example does this report relate to?

/~https://github.com/takeseem/demo-nextjs-v14/commits/main/

What browser are you using? (if relevant)

chrome 131.0

How are you deploying your application? (if relevant)

pnpm dev

Describe the Bug

  • pnpx create-next-app@14.2.23
  • add react StictMode test code in the Home page src/app/page.tsx
    useEffect(() => {
      console.log(new Date().toLocaleString(), "App mounted");
      return () => {
        console.log(new Date().toLocaleString(), "App umounted");
      }
    }, []);
  • it's work

Image


  • test in nextjs v15.x and v15. canary is fail
  • test code

Image

Expected Behavior

  • reactStrictMode: true work in v15

To Reproduce

  • git clone git@github.com:takeseem/demo-nextjs-v14.git
  • cd demo-nextjs-v14 && pnpm i && pnpm dev
  • http://localhost:3000
  • check dev tool console out like this

Image

@takeseem takeseem added the examples Issue was opened via the examples template. label Jan 16, 2025
@takeseem takeseem changed the title reactStictMode is not effect in nextjs v15.x, but it's work in nextjs v14 reactStrictMode is not effect in nextjs v15.x, but it's work in nextjs v14 Jan 16, 2025
@samcx samcx added bug Issue was opened via the bug report template. and removed examples Issue was opened via the examples template. bug Issue was opened via the bug report template. labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants