I created a 500 line sketch in the web editor which compiles and runs well.
I split the code into tabs in the web editor and couldn't get it to compile without errors. I spent hours searching for solutions but gave up and used the desktop (Windows) IDE instead.
The desktop IDE compiled and worked well with the sketch split over tabs.
I then imported the sketch into the web editor and it compiled and ran well.
Seems to be a problem in compiling sketches from tabs created in the web editor.