Chrome Loading an Old Version of Javascript File Chrome Loading an Old Version of Javascript File apache apache

Chrome Loading an Old Version of Javascript File


If it works upon rename, and then stops working, then it can not be a cache of any kind (except maybe "a seriously broken one") nor a file modifying thing (e.g. BOM, rogue CR's, etc.).

But I'm guessing that the file works, and then it stops working not "after a while" but "after you save it again making what seems to be a very minor and unrelated change".

If this is the case you're probably dealing with rogue CR's or weird EOF handling: try checking the file on disk with a different editor (a hex editor ideally), and/or opening it with the simplest text editor you have.

If you have a bare CR as the last character of the file, some editors and platforms will add two "strange characters" (actually another LF and another rogue CR) every time you read/write the file again. And those same editors won't show you those characters, so you won't be able to delete them from those editors.

UPDATE:Another distinct possibility is that you have a "hidden" UTF-8 character (or fragment thereof) which is not correctly detected. Then something very like this happens:

Visual Studio 2008 project file does not load because of an unexpected encoding change

...and notice that the strange characters you are getting are exactly the UTF8 signification for encoding error, which also would explain why Chrome detects an unexpected end of input.

Try blindly selecting from the last few lines of code to the end of the file and delete the selection, then write it back:

            return 'A general error occurred';        }    }})/* END OF FILE */

and save. This ought to clear things. Check with the hex editor from 'occurred' onwards if any strange characters are present.