It's common to rename files while working on a project:
- Rename files from .js to .ts (and .jsx to .tsx) when migrating gradually to TypeScript.
- Move a main function.js file to function/index.js when its complexity grows or a proper structure is needed.
However, as soon as you rename a file, you see the following error in development:
Failed to compile.
./src/test.js
Error: ENOENT: no such file or directory, open '/Users/my-user/test-project/src/test.js'
At this point, the only solution is to restart the development environment which takes time on some projects so it's not ideal.
Proposed solution
If renaming a file results in the same resolved file for the compiler, it should be handled automatically.
It's common to rename files while working on a project:
However, as soon as you rename a file, you see the following error in development:
At this point, the only solution is to restart the development environment which takes time on some projects so it's not ideal.
Proposed solution
If renaming a file results in the same resolved file for the compiler, it should be handled automatically.