Link to home
Start Free TrialLog in
Avatar of paragram
paragram

asked on

Chrome external javascript edit problem in Visual Studio

Has anyone seen this before? When using Chrome while debugging with Visual Studio, if I edit an external JavaScript file, Chrome keeps using the old file unless I rename the file. It's the stickiest caching I've ever experienced.

And that means renaming the file, changing its name as the "src" attribute in the JavaScript include line, and changing the name in the solution explorer. What a pain! Does anybody know about this? Am I skipping a step? IE-8 works fine -- I only have to make edits, like normal.

Mind you, I'm not trying to use the V/S debugger to step into the Chrome browser JavaScript. But I am doing a view source on Chrome, and I'm also looking at the script markup using the Chrome Develper Tool. In all cases, it is caching the old file. Even if I quit Visual Studio and restart. The only way I could get it to recognize my edits was by doing a filename change -- this happened every time I did an edit! (So I did most of my debugging with IE, then only the final testing with Chrome -- where I found a few things I had to fix.)

Thanks.

Paragram
Avatar of Gary
Gary
Flag of Ireland image

Goto developer tools - Spanner, Tools, Developer Tools
Bottom right corner click the Gear symbol and check disable cache
Avatar of paragram
paragram

ASKER

Boy, I was hoping!! But no joy. I made the change, and still, when I edit an external .js file, the changes are NOT being seen. This time I only looked inside of Developer Tools, since that's where it really counts. I changed 3 lines of code, and ran under IE and it worked fine. Chrome gave me an Uncaught TypeError because the fix I implemented was not being seen. (Basically I deleted 3 lines).

Even more shocking(!), if I edit the file INSIDE of Chrome's Developer Tools and SAVE it there (by right-clicking on it in the Sources tree and selecting Save (which then automatically updates my open copy inside of CodeWright -- so I know it's really being written to the proper folder) and then restart the V/S debugger, IT STILL goes back to the earlier version when I look at the code on the Source tab INSIDE Developer Tools!!!

I did what you said -- checked the box for Disable Cache!! Is this FUBAR or what?? Would you try what I am doing for me--remember, this is an External file. For inline JavaScript (or other edits in the .aspx file) there is no caching.

Help!!!

Paragram
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Now how in the heck did you figure that out?

OK, first of all, no there is no download manager. I don't even know what context that question makes sense (everything is local -- I am debugging on the same machine where I am editing the sources.)

But the incognito window. It works. The "regular" window keeps thinking it is using the old file, but the incognito window sees the new markup in the external file. WHY IS THAT? AND HOW, PRAY TELL, do I EVER get the "cognito" window to see the new edits? The kluge I was using was to rename the file twice, once to a new name and twice back to the original name -- which is really dumb. Is there no better way??

Paragram
Please see my final post -- and answer if you can. - Paragram
Gary (please see my previous post) -- do you have a V/S setup? Did you try what I was doing to see if it happened for you as well?

Paragram
Incognito window is like IE's in private browsing - nothing is saved, cookies deleted after the session etc
If you have a download manager it maybe interfering with the cache

I have experienced the same problem with Chrome
Gary,

Not sure if you'll keep monitoring this thread because I've accepted a solution (yours!) but I would like to learn something and you seem to have patience.

I'm not trying to say you were wrong -- but about the download manager... When I'm developing on my own box where the compiler is local (admittedly with a remote database), there's no role for a download manager, right? You were refering to a setup where I have to upload or download source or object files, weren't you?

So for my setup, the download manager issue wasn't relevant, right? (God, I know this sounds like a put-down or something. But honestly, I just want to be sure, because you are obviously a smart guy. Just tell me, in case it comes up again -- do people use download managers when they're developing "locally" like I am here? Thanks.

PS. My friends tell me I perseverate! Forgive me.

Paragram
No, ignore the download manager bit, I was doing a dozen things at the same time and not thinking about it properly
Just a final kudo to Gary. He patiently answered ALL my questions and I think this will be a very useful thread for anybody else who has a similar problem.