Folders missing in project pane in Webstorm

Find the .idea/modules.xml in your project root make sure that these lines are correct :

<modules>
  <module fileurl="file://$PROJECT_DIR$/.idea/NameOfYourProject.iml" filepath="$PROJECT_DIR$/.idea/NameOfYourProject.iml" />
</modules>

Replace NameOfYourProject.iml with the name of your project.

Then, make sure that the file .idea/NameOfYourProject.iml exists, if not , create it and put this in it :

<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
  <component name="NewModuleRootManager">
    <content url="file://$MODULE_DIR$" />
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="module-library">
      <library name="PHP">
        <CLASSES>
          <root url="file://$MODULE_DIR$/../../php/PEAR" />
        </CLASSES>
        <SOURCES />
      </library>
    </orderEntry>
  </component>
</module>

It can be caused by the corrupted .idea/modules.xml project file. You can either try to fix it manually (restore from Local History, version control or backup) or create the new project from scratch.

Check this issue for the hints/workarounds.


Solution:


Creating a new project from existing sources

  1. File => New => Project
  2. Select "Empty Project"
  3. Browse to the location of your project with folder issues
  4. Click "Create"
  5. Select "Create from Existing Sources" in the "Directory Is Not Empty" dialog

Why this solution:


Editing and deleting in various combinations of .idea and XML files did not solve the issue for me. Hence the solution above. Back up your .idea directory in case you have project customizations you want to keep. This likely overwrites them.

Outcome:


All the various folders I had created were now visible and the project worked as expected. The .idea directory was now formatted correctly with all the necessary files.


It happens sometimes in WebStorm 9. The easiest way to fix it for me:

  1. close WebStorm;
  2. in project's folder remove .idea/ (hidden directory);
  3. open your project, enjoy:)

Tags:

Ide

Webstorm