Not in the project - missing route

I'm working on a project we have developped. I opened a New project in PhpStorm, and connect to my Github. I pulled the project, and try to work with.

It's a project using Symfony5, called Olymphys-4 (website olymphys.fr, github : DenisPIcard/Olymphys-4)

Each time I try to edit a script , PhpStorm say : it's not in the project, should I edit anyway ?

The Each route yet in the project is highlighted, with "Missing route"

Each time I try to commit the project, the routes are in error, and  I have to force the commit.

And, in spite of it all, when I execute my project with "symfony serve", every thing works fine...

The debug:router find all the routes...

Where is my issue ?

0
9 comments

Could you please show a screenshot from the "Preferences/Settings > Directories" window, do you have any directories there?

0

Thanks for tour reply.

That is the screenshot

0

@Denis Picard

Accordingly to your screenshot it's absolutely empty... which is wrong (by default every project consists of one Content Root)

Do you also have a yellowish kind of color background in the Project View panel?

Right now it looks like your project config is somehow corrupted and the IDE treats all files as "outside of the project". Try using "Add Content Root" there and point to the project root folder.

If that does not help -- I may suggest the following:

  • Close this project (and other currently opened projects) so that you see the Welcome screen.
  • Locate that bad project there and remove it from that screen
  • Close the IDE
  • Go to the project root folder and backup & delete .idea subfolder (it contains the project settings)
  • Launch the IDE, use "Open" and point to the project root folder -- the IDE will create a new project from existing files (you would just need to configure it).
  • If it works and so desired -- you can recover some of the config files from the backup (while project is closed in the IDE of course).
1

This is something that occasionally happens nowadays but we cannot catch the pattern yet. However, as Andriy has fairly suggested, the ".idea" folder re-creation helps in most of these cases.


By the way, before re-creating the ".idea" folder, could you please check if there is a "modules.xml" file inside?

0

Thanks, I will try that.

@Vassily :

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Olymphys4.iml" filepath="$PROJECT_DIR$/.idea/Olymphys4.iml" />
</modules>
</component>
</project>

 

0

@Denis Picard

Do you have that Olymphys4.iml file (from that old/"broken" state)? Can you show it here similar to the above?

0

@...:

<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
  <component name="NewModuleRootManager">
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="App\" />
      <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="App\Tests\" />
    </content>
    <orderEntry type="sourceFolder" forTests="false" />
  </component>
</module>
0

@Denis Picard

Thanks. The only notable difference I can see is that your file does not have type="WEB_MODULE" part:

<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
...

Maybe it will give some hints to JetBrains devs...

0

Thanks for your concern.

I've tried...

First, in Settings>Directories, I added, by mistake, the repertory of my templates.

Then, reading better your reply, I've addd my root repertory. Trying to remove the other, I have removed it from the project !

Then, I have followed your reply : baclup an remove the .idea, but I can't remove the all project...

And trying to recover the idea file, the anwer is : There is a file named .idea,  But I can't find id !!!

Anyway, my project runs...

0

Please sign in to leave a comment.