localでの build は通るのに github actions での build が通らないエラーに遭遇したので忘備録
エラーメッセージ
Creating an optimized production build...
▲ Failed to compile.
▲ ./app/maps/page.tsx:4:0
▲ Module not found: Can't resolve '@/components/input'
aliasの登録はしている。
tsconfig.json
...
"baseUrl": ".",
"pahts": {
"@/components/*": ["./components/*"],
...
}
./components/input/index.tsxも存在している。
原因
Github 上で ./components/Input/index.tsx と input がパスカルケースで登録されていた。
そういえば間違って最初に大文字でディレクトリを作った気がする。。
Github上で大文字小文字の認識がされておらず、CI 上では未追跡の@/components/inputを参照しようとしていたのが問題になっている。
これで認識される
git config core.ignorecase false
参考