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

11 comments

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- 

0

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.

0

 

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

0

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

However, when I do that the file does not resolve.

If I remove the leading /, then it resolves properly

Here is my file structure

Am I doing this wrong? everything I've read says root starts with a /

Thanks,
Dave
0

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.

0

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

and both css and script directories are not resolved.

In the second project I have a document root set

and in this project everything resolves properly.

SO, there must be some other setting that I have Incorrect.

Thanks,

Dave

0

It's "Settings/Preferences | Languages & Frameworks | PHP" -- show what you have got there,

1

Here you go...

Thanks,

-dmd-

0

Please remove that entry and wait until IDE finish reindexing. Any better?

1

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

0

Please sign in to leave a comment.