WebGL compile produces compiled old version of the code

I have a strange problem when the compiling for WebGL, namely, I make a change and compile but the compiled code does not reflect the change, it is as if I had compiled the older version. For example, in the very first screen of the game I put a number, say 4, and in the code I change it to 5, I run the code in Unity it displays 5 as expected, then I compile for WebGL, load it in browser and I see 4, not 5! I have tried to following:

  • restart Unity
  • delete the produced code
  • compile multiple times
    but nothing really consistently solves the problem. At some point it just compiles the new code but I have no idea when and why Unity decides to compile the new code instead of just give me the older produced one. Any compile - even those that produce older version - don’t give any errors, they finish as if everything is fine.
    Any clues / suggestions how to solve this?
    Btw I am using Unity 5.5.0f3

Am I the only one who has encountered this issue?

any error in the editor log?
does deleting Library/il2cpp_cache help?

It is the same in the browser? Have youvtried flishing the browser cache or using incognito mode?

I can’t reproduce the problem now :frowning: all of a sudden everything works fine, and I had this problem for weeks. What I did was deleted the entire Library folder (which I read on the forum is relatively safe to delete) and rebuild the project.

It could have reported some error in Editor.log, I was only looking at the console and there were no errors there.

What I suspect to have been the problem is my component that does some image processing on gameobjects from the scene in Start() and onValidate() methods, at one point it was crashing Unity when loading the project and I had to comment these methods to even load the project.

If I manage to recreate the problem again I will put more details here.

Tried incognito, different browser and load from different computer but the problem persisted. This was actually my first suspicion - not exactly the browser but the apache server where I’m hosting the content I thought its cash memory causes the problem but I quickly found out it was not…

I had the same problem but found a solution in deleting the Scenes in Build under Build Settings and then adding them back