Cannot resolve file warning
In my html files I have such codes:
<img src="/img/some/myphoto.jpg" width="240" height="182" alt="myimage"/>
phpStorm gives me
"Cannot resolve directory some"
"Cannot resolve file myphoto.jpg"
errors.
I know that this directory and file exists inside one my my subfolders of project.
I don't want to suppress this warning because this information is valuable for me.
How can I solve this and show proper folder path for my project and file?
"Cannot resolve directory some"
"Cannot resolve file myphoto.jpg"
errors.
I know that this directory and file exists inside one my my subfolders of project.
I don't want to suppress this warning because this information is valuable for me.
How can I solve this and show proper folder path for my project and file?
Please sign in to leave a comment.
Hi there,
Mark parent folder of that /img/ folder as Resource Root.
Solved. Thank you very much.
FYI - I found this solution numerous places yet could not get it to work. After numerous attempts of setting root directory properly, the error messages just would not clear. Finally, I made a change to the file and saved and the errors disappeared!
Hi,
How tgo mark parent folder as Ressource Root ?
Regards
@Amaury
Either "Settings/Preferences | Directories" (https://www.jetbrains.com/help/phpstorm/directories.html) or via right click in the Project View panel and then "Mark Directory as..."
Intellij IDEA 2017.2.3 with the root marked as resource root still doesn't find the files placed inside.
please attach a screenshot illustrating the issue
Tried marking as resource root, no success..
If you marked your project root as Resource Root, completion will work in a way relative to it so you should have public/images/bckg-img.jpg resolved.
You set the full absolute path there - IDE cannot resolve this against current project structure.
Thanks, Vladimir!
I have the same issue.
I have two js files in a directory that is marked as a resource. root.
calendarDataInput.js gets the warning: Cannot resolve file.
calendarDataInput20110220a.js does not get a warning.
As mentioned above I tried editing the file to see if that would clear the warning. It did not.
Any suggestions?
Here is a screen shot
@Ben Bachrach
IDE is correct :)
Please check the actual file name and the reference (I mean value in "src" attribute) -- they are pointing to differently named files.
calendardatAinput and calendardatEinput -- I've used capitals to highlight the difference.
Sorry, I see the typo now.