Hm, that sounds like a frustrating bug! I have not seen that before. Could you please try opening the browser console (right click outside the game->Inspect Element->Console) and see whether there are any errors there and copy them to a new comment?
When does this error happen? Randomly or when you do something specific? (e.g. loading a save file)
You can also try Exporting your save regularly so you lose less progress as a band-aid solution, of course I'll try to solve the real problem too.