Fix VSCode Import Warnings (ts1261) After Renaming File Casing with Reload Window

Jan 15, 2024Jun 17, 2025 Updated📖 5 min read | 2,790 charsWeb DevelopmentVSCode

When doing web development with VSCode, you sometimes need to rename component files — for example, changing homeHero.js to HomeHero.js, where only the letter casing changes.

In such cases, have you ever encountered the following warning (ts1261) in your import statements?

Already included file name 'src/components/home/HomeHero.js' differs from file name 'src/components/home/homeHero.js' only in casing. The file is in the program because: Imported via "./home/HomeHero" from file 'src/components/Layout.js' Root file specified for compilationts(1261)

The path is correct, the Git core.ignorecase setting has been verified... yet the warning persists. In such cases, the issue is most likely caused by VSCode's internal cache or file recognition.

This article shows you a simple way to resolve this annoying warning.


Solution: Reload the VSCode Window (Developer: Reload Window)

In most cases, simply reloading the VSCode window resolves this warning.

Steps:

  1. In VSCode, press Ctrl + Shift + P (or Cmd + Shift + P on Mac) to open the Command Palette.
  2. Type "Developer: Reload Window" and execute the displayed command.

That's all it takes — VSCode will reload, properly recognize the file name change, and the import warning should disappear.

The Developer: Reload Window command is also useful for other minor VSCode issues, such as:

  • IntelliSense not working properly after creating a new file.
  • Syntax highlighting breaking after installing an extension.
  • General editor instability.

When VSCode feels off, trying Developer: Reload Window first is a quick and effective troubleshooting step.


Bonus: Git's core.ignorecase Setting

While this wasn't the direct cause of the import warning (ts1261), you may also run into issues on the Git side when changing file name casing. Here's a quick note for reference.

In web development, when you change only the casing of a file name (e.g., index.jsIndex.js), Git may not detect the change as a diff, making it impossible to commit or push the change to a remote repository.

This happens because Git's default setting (especially on Windows and macOS) doesn't distinguish between uppercase and lowercase in file names (core.ignorecase = true). To Git, index.js and Index.js are the same file.

To fix this, change the Git configuration for the repository to recognize case differences. In your terminal, navigate to the repository directory and run:

git config core.ignorecase false

After running this command, Git will distinguish between uppercase and lowercase file names in that repository, properly detecting changes like index.js to Index.js as diffs.

If Git isn't detecting your file name casing changes, check and update this setting. (Note: extra caution is needed if the OS file system itself is case-insensitive.)

Share this article