I've just solved this problem without having to delete the .idea
folder (and thus having to re-configure the workspace), in WebStorm, but I assume it's going to be the same for IntelliJ and other JetBrains IDEs.
First, close your IDE and backup the .idea
folder.
In .idea
folder there should be .iml
file with the name of your project. In my case it's ClientApp.iml
. This file defines, which directories belong to the project, which should be excluded etc. Note the name of this file in your .idea
folder.
Next, open modules.xml
file. It should look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ClientApp.iml" filepath="$PROJECT_DIR$/.idea/ClientApp.iml" />
</modules>
</component>
</project>
Check if fileurl
and filepath
match name of your .iml
file, if not fix the filenames, save and re-open your IDE. For me, this fixed it.
People in other answers are right that this is a problem with Modules. In WebStorm in 2024, there are no modules in Settings, I think it was renamed to Directories. When I added the project root this way, the project got renamed and all folder settings (test, resources, excluded) were lost, so fixing the .xml
file seems like a better option.
.idea
folder – Lunetta.idea
folder is missingmodules.xml
&terrafuse.iml
. So, I copy this two files from.idea
folder of another project and restarted the IntelliJ which in turn start working normally. – Corporal