phpstorm 18 not resolving directories/files. Worked fine in phpstorm 17
Since upgrading to phpstorm 18, I have started seeing "Can't Resolve File" and "Can't Resolve Directory" in files that had no errors in phpstorm 17. Nothing else has changed.
Thanks,
Dave Davis
Please sign in to leave a comment.
Hello,
Where do you see these errors?
Is this related to or duplicates the other thread https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000446024-Running-Individual-files-on-remote-server-with-PHPStorm ?
No, it is not related to the other post..
In any file that links to other html files (CSS and <script>) I see this
when I mouse over, I see "cannot resolve directory" or "cannot resolve file". However, everything is working normally. This just began when I installed PHPStorm 18. No problems with 17.
Thanks,
-dmd-
Dave, which version exactly were you using prior to upgrading to 2018.1?
We have this issue that may be the cause: https://youtrack.jetbrains.com/issue/WI-41026
If it's not the case, please share your Settings | Directories and Settings | Languages & Frameworks | PHP | PHP Include contents.
The problem was that I had a content root entry. If I put it there, I certainly don't remember doing so. It may be that phpstorm 18 adds it automatically.
At any rate, I removed the content root and now these files resolve correctly.
Thanks for your help.
Dave
I spoke too soon. while removing the document root lets css and script files resolve, I find that it must be there for the project pane to show the files in the project.
So, we are back to square one. Although everything works,
My understanding is that the root starts with a /
So for the file world.css in the directory css, I would say
Dave, please check my previous request - do you have the project root added as PHP Include?
The issue you're seeing fits quite well in the bug I posted.
If you don't have anything added as PHP Include, I think we would need your project (or maybe a simple replica of it) for reproduction.
Eugene,
Excuse my ignorance but I'm not quite sure what you mean by project root added as a PHP Include. When I google phpstorm project root I see a page configuring on Content Roots....
https://www.jetbrains.com/help/phpstorm/configuring-content-roots.html
I do have a Content root set.
I currently have two projects.
In the first one I have the Document Root set as follows
In the second project I have a document root set
SO, there must be some other setting that I have Incorrect.
Thanks,
Dave
It's "Settings/Preferences | Languages & Frameworks | PHP" -- show what you have got there,
Here you go...
Thanks,
-dmd-
Please remove that entry and wait until IDE finish reindexing. Any better?
Seems to work perfectly. Thanks for your help.
Incidentally, that must be placed there automatically in version 18. I'm virtually certain I didn't do it.
Thanks again
Dave