This worked for me, Try Ctrl+S on the pages that give you this error.
The error came about, when my visual studio crashed(restarted). The pages I was working on(before the restart) didnt failed to build.
Which lead me to think the didnt save correctly. Hence, Ctrl+S. That solved my issue.