Javascipt debugging not updating after source code change

For the last 6 month I have only been able to debug javascript code properly if I do a ‘Clear file system cache and local History’ from then File→Invalidate Caches and press the ‘Invalidate and Restart’ button.  
Need to do this every time I have changes the JS source code. 
I'm using chrome browser and have disable cache, which correctly reload all latest js files .. And if I set an breakpoint in the Chrome Dev tool  debug windows it works fine and breaks in latest js source code. 
BUT in WebStorm the editor keep showing old source code until I do the  ‘Clear file system cache and local History’ 
Quite time consuming and I is also stupid that the Local History is lost every time. 
Restarting the debug session does not solve the problem as it keep using old outdates js source code.
All debug sessions are started from WebStorm. 

How do I solve the problem that WebStorm is NOT reloading and using latest source code ? 

 

0
10 comments
I would appreciate it if you could provide more details about the project setup. Which build tools are you using to bundle the project, and on which web server is it hosted?

Could you please consider isolating the issue to a minimal repository project and sharing it with us? Kindly include a detailed description of the steps you have taken.

Thank you.
0

My development server is Laragon (PHP8.3, Apache 2.4) running on a windows 10 
I'm not using any build tools. 
The problem seem to be related to webstorm file-cache as I have disabled cache in chrome browser, where it seem to work fine (reload latest sourcefiles)
I can not share as it is to big a project .. but you can contact med and I can show it. 
Please explain what kind of project setup you want to know about ?

 

0

Do you have your project located in the web server doc root, or you have your sources located elsewhere and deployed to the server once the file changes? Could you check if you can reproduce the issue in a new project using similar setup?

0

If you know the Laragon ,, then public_html (root) is not used at I have used the ‘Switch Docement Root’ to another location.
Meaning that web server root is pointing directly on the same folder at webStorm source folder 

0

Just tried to match the local folder with the remote url .. would this be missing link (proper the solution).
For now it seem to work !! 

 

0

Actually this solution was initiated by at quick test trying to debug php/js on the same code base, but using VSC. 
Funny that the VSC is loading instantly and are much quicker ;-) .. maybe you should push this info back to the development team.
 

0

Great, thanks for update! yes, loading the outdated stuff while debugging can be a symptom of the problems matching your actual source path to the URL. Specifying the URL mappings is a right solution. 

0

<component name="ProjectRunConfigurationManager">
 <configuration default="false" name="index.php PHP JavaScript" type="JavascriptDebugType" uri="http://localhost" useFirstLineBreakpoints="true">
   <mapping url="http://localhost" local-file="$PROJECT_DIR$/public_html" />
   <method v="2" />
 </configuration>
</component>

0

Thanks for verifying :-) 

Have nice day 

0

Have a great day, too!

0

Please sign in to leave a comment.