Error and reload during HMR with MUI #69008
Labels
bug
Issue was opened via the bug report template.
Developer Experience
Issues related to Next.js logs, Error overlay, etc.
Link to the code that reproduces this issue
https://github.com/Janpot/next-mui-reproduction
To Reproduce
Clone https://github.com/Janpot/next-mui-reproduction (can't reproduce this in codesandbox/stackblitz)
Run
pnpm install
Run
pnpm dev
Open http://localhost:3000/
Open browser devtools, make sure it preserves logs on reload (e.g. on Chrome console settings: "preserve log")
Open src/app/page.tsx and replace the content:
to
Save
Current vs. Expected behavior
The page reloads and a series of warnings and errors appears:
I expect it to not error and just React refresh. The issue is also present on stable albeit with different console output.
Note that it happens with any new component that I import from
@mui/material
and it doesn't seem to matter whether I import them from the top-level, or from their subpath (@mui/material/Button
).When I add
'use client'
to the page, the issue doesn't happen.Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.5.0: Wed May 1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 18.20.2 npm: 10.5.0 Yarn: 1.22.22 pnpm: 9.7.1 Relevant Packages: next: 15.0.0-canary.119 // Latest available version is detected (15.0.0-canary.119). eslint-config-next: N/A react: 19.0.0-rc-1eaccd82-20240816 react-dom: 19.0.0-rc-1eaccd82-20240816 typescript: 5.5.4 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Developer Experience
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
Was testing out some upcoming changes in MUI when I noticed this problem
The text was updated successfully, but these errors were encountered: