I've seen lots of threads discussing the [object Object] error, and the only solutions I could find suggested to update the board, disable the antivirus, etc, but none of those worked for me. Since all those threads are closed, I'm opening a new one.
Also, while in the Web Editor the [object Object] error appeared, in an old version of the Arduino program for Windows (whose version I can't remember), it just compiled forever, so you might be interested in this as well if you're having that issue.
After a full week of trying to found a fix, a friend of mine pointed out that I was using the pin 1 for a LED. And that's the fix: Do not ever use pins 0 or 1 for stuff like LEDs or other components. I don't know what their purpose is, but it was the cause of the error. After moving the LEDs to other pins the program compiled successfully.
The thing is, why doesn't the IDE report about this error? Why doesn't it say "using illegal pins" or something similar, instead of throwing a completely useless error message?
This definitely needs to be fixed, as I'm sure many people (like me) have been having headaches over this. Thank God (well, my friend, actually) I was lucky to find a solution.