Next.jsでMUIのTypographyを設置すると「Element type is invalid」とエラーが出るときの対処法

この記事は約1分で読めます。
スポンサーリンク

エラー

Next.jsにおいて、MUI要素であるTypographyを特定条件下で配置した際、以下のようなエラーが発生します。

Error: Element type is invalid. Received a promise that resolves to: undefined. Lazy element type must resolve to a class or function…

環境

Next.js : 14.0.4

スポンサーリンク

対処法

特定バージョンの不具合の可能性が高いです。
バージョンを下げることで解決できます。

Next.js 14.0.3であれば、問題なく動作します。
package.jsonのNext.jsを14.0.3に書き換え、npm installを実行します。

文献

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) in react native project

 

コメント

スポンサーリンク
スポンサーリンク
タイトルとURLをコピーしました