Folders missing in project pane in Webstorm

34,003

Solution 1

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 2

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:)

Solution 3

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.

Solution 4

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>

Solution 5

You do not need to delete whole .idea folder and reconfigure your whole project, just

  1. delete the .idea/modules.xml
  2. restart the IDE and your folders are there again!
Share:
34,003

Related videos on Youtube

Chase Florell
Author by

Chase Florell

I'm a developer in BC Canada and one of the owners of Flo Media Group Inc. I work primarily in C# .NET, Xamarin, HTML5 and Javascript, and I'm also very passionate about DevOps, and have been known to sling my fair share of PowerShell. When I'm not coding, I'm enjoying time with my wonderful wife and children, riding my motorcycle, camping in the summer months, snowboarding in the winter, or maybe just a round at the Golf Course. I Blog Here, and I'm also on Linkedin Contact Me

Updated on October 12, 2021

Comments

  • Chase Florell
    Chase Florell over 2 years

    I've built a project in WebStorm and then submitted the project to GitHub.

    When I rebooted the computer and relaunched WebStorm (and the project), all I can see in the project pane is the root files, and none of the folders (yes the folders are there)

    See the image below for reference.

    Does anyone know how I can get those folders to re-appear in the project pane of Webstorm?

    enter image description here

  • Chase Florell
    Chase Florell about 12 years
    Yup, just got an email back from Jetbrains. I had to do a terminal command $ rm -r .idea then open the directory in Webstorm. This rebuilt the project for me.
  • Chase Florell
    Chase Florell about 12 years
    in fact, I got the email from you ;-) Thanks for the help and direction.
  • Chase Florell
    Chase Florell about 12 years
    Thanks, creating the new project was quick and painless.
  • Chase Florell
    Chase Florell almost 9 years
    so you're just repeating what the accepted answer states... 3 years later? stackoverflow.com/a/9302503/124069 (read the comments)
  • cwallenpoole
    cwallenpoole over 7 years
    I was able to just delete the modules.xml file. It saved the rest of the project settings, which was welcome.
  • Umit Kaya
    Umit Kaya almost 6 years
    Sometimes, only restarting IDE helps!
  • techkuz
    techkuz almost 6 years
    @ChaseFlorell in accepted answer you have to read comments, check links (spend extra time). This answer provides 3 simple steps and off you go.
  • dasfdsa
    dasfdsa almost 6 years
    For me, manually deleting .idea file didn't work but doing rm -rf did. Weird.
  • Syclone
    Syclone about 4 years
    For me NameOfYourProject.iml was pointing to the wrong file. Updating it to the correct file name fixed my issue and I didn't lose any settings.
  • Nicolas  Mauricio Cuadrado
    Nicolas Mauricio Cuadrado almost 3 years
    I'm trying this but not getting any result in the latest Webstorm version 2021.1.1. anyone have faced the same? I just can't see the files in my project.