Error
In Next.js, when placing the MUI element Typography
under certain conditions, the following error occurs:
Error: Element type is invalid. Received a promise that resolves to: undefined. Lazy element type must resolve to a class or function...
Environment
Next.js: 14.0.4
Solution
This is likely a bug in a specific version.
Downgrading the version can resolve the issue.
It works without problems on Next.js 14.0.3.
Modify the Next.js version in package.json
to 14.0.3
, and run npm install
.