Search Unity

WebGL compile produces compiled old version of the code

Discussion in 'Web' started by zharko, Jan 16, 2017.

  1. zharko

    zharko

    Joined:
    Jan 25, 2015
    Posts:
    21
    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
     
    Last edited: Jan 16, 2017
  2. zharko

    zharko

    Joined:
    Jan 25, 2015
    Posts:
    21
    Am I the only one who has encountered this issue?
     
  3. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    any error in the editor log?
    does deleting Library/il2cpp_cache help?
     
  4. AndresSepulveda

    AndresSepulveda

    Joined:
    Mar 12, 2014
    Posts:
    52
    It is the same in the browser? Have youvtried flishing the browser cache or using incognito mode?
     
  5. zharko

    zharko

    Joined:
    Jan 25, 2015
    Posts:
    21
    I can't reproduce the problem now :-( 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.
     
  6. zharko

    zharko

    Joined:
    Jan 25, 2015
    Posts:
    21
    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...
     
  7. sawysauce17

    sawysauce17

    Joined:
    Feb 26, 2021
    Posts:
    1
    I had the same problem but found a solution in deleting the Scenes in Build under Build Settings and then adding them back