I am working on my thesis and, all of sudden, overleaf didn't want to compile and showed a lot of compiling errors. I deleted the cache clicking on the option in the bottom right corner and then it compiled again without any problem. Do you know why this happens?
LaTeX is multi-pass system, a lot of information is saved to files to be read next time. Cross references, tables of contents, bibliography entries... On Overleaf you are not normally explicitly aware of the separate passes as Overleaf (using
latexmk) runs latex in the background as often as needed to resolve all the references.
However if you have an error that causes bad commands to be written to the aux file on one run, this file will be read in at the start of the next and can cause errors. Even if you fix the original error in the main file the old bad aux file may generate errors and prevent a clean run. Clearing the cache deletes the problematic file, allowing a good one to be generated from the corrected main file.