I consistently get 6 of them. The problem is that when I click it, it doesn’t take me to where in the script the error is so I have absolutely no clue how to debug this. I should mention that the game runs absolutely fine with the error, but I do not want this to cause any unexpected problem in the future.
Hate to necro this, but since it persists in 19.1.1f1:
The problem is, you’re previewing a Serialized object from your Project, in one (or both) of your Inspector windows. When you have 2 (or more) Inspector windows open while you preview a ScriptableObject Asset, you’ll get that error and be unable to compile. The reason why “it fixed itself” by restarting Unity is that your Windows Layout did not save, so you restarted with only 1 Inspector window open.
TLDR: Close any other Inspector Windows you have open while previewing a Serialized object asset. Make sure you have only 1 Inspector Window open, while previewing your SerializedObject Asset.
I’ve submitted a Bug Report to hopefully have this fixed in the future.