【Next.js/Reactエラー】Error: Element type is invalid: (for built-in components) or a class/function (for composite components) but got: undefined

 エラーの全部はこちら
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports.

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

大事なメッセージはこの部分。
You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports.
コンポーネントのimportまたはexportの定義がおかしい。みたいなことをいっています。
そこでソースを確認したところvscodeでエラーマークが付いてました。
NGだったコードがこちら。 { Layout }がダメでした。
  1. import { Layout } from ‘../../components/Layouts’
{}を外しました。

  1. import Layout from ‘../../components/Layouts’
exportしている側はこちら。
export defaultしている場合にはimport側は {}が不要なわけですね。{}が必要なのはexportしている側で名前付きexportしている場合っぽいです。