1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【GitHub Actions】ファイル名の大文字・小文字変更がリモートに反映されない問題と対策

Posted at

# 問題
GitHub Actionsで以下のエラーが発生。

Error: src/App.tsx(13,20): error TS2307: Cannot find module './MyPage' or its corresponding type declarations.
Error: src/__tests__/MyPage.test.tsx(3,20): error TS2307: Cannot find module '../MyPage' or its corresponding type declarations.
Error: Process completed with exit code 2.

原因

ローカルでは MyPage.tsx(Pが大文字)にリネームしたのに、
リモート(GitHub)では Mypage.tsx(pが小文字)のまま残っていた。

ローカル
image.png

リモート(GitHub)
image.png

解決策

一度別名にリネームしてから、正しい名前にリネームする。

git mv src/Mypage.tsx src/Mypage_temp.tsx
git mv src/Mypage_temp.tsx src/MyPage.tsx
git add src/MyPage.tsx
git commit -m "fix: rename Mypage.tsx to MyPage.tsx (case only)"
git push

終わりに

ファイル名の大文字・小文字変更は、意外と見落としがちな落とし穴でした。
参考になれば幸いです。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?