Netlifyデプロイに失敗したケース

コンポーネントをインポートした時の単純な指定ファイル名のミスだったという話

Deploy logを確認すると

  • 12:29:16 PM: error Generating JavaScript bundles failed
  • 12:29:16 PM: Can't resolve '../components/Layout' in '/opt/build/repo/src/pages'
  • 12:29:16 PM: If you're trying to use a package make sure that '../components/Layout' is installed. If you're trying to use a local file make sure that the path is correct.

Layoutコンポーネントを、小文字のファイル名でlayout.jsを作成していたのに
インポートするときにLayoutと大文字になっていただけでした。

Layoutの部分をコピペして放置が原因で無駄な時間を過ごしたので自戒を込めてメモ

// import Layout from "../components/Layout"

// 修正
import Layout from "../components/layout"
ページ上部へ