Empty parse error in shader at line 1

We have a relatively larger project with multiple contributors. At some point we started to get the following error:

Shader error in ‘’: Parse error: syntax error at line 1

There is no indication which shader generates the error, and there are no rendering errors in the scene (no purple objects) We only get this error when we press play (a recompilation or build of the project does not generate the error) and we get it like 10 times and then it stops. We tried forcing a recompile by deleting/editing a few shaders that were modified recently, unfortunately to no effect.

I’ve also read somewhere that the line endings could cause this error but that doesn’t seem to be the case here. We’re using Unity Pro 4.5.5p4.

Does anyone have an idea on how to identify which shader is generating the error (instead of deleting them 1 by 1) or how to stop it from occuring?

In my experience, this can be caused by the wrong file encoding. Shader files should be UTF8 with no BOM (although, previous problems with BOMs were apparently fixed in 4.5, so if you’re on 4.5.5 that shouldn’t be a problem).

Are your multiple contributors using a mixture of Mac/PC/Linux? What encoding are they using?

Everyone is using PC currently, I checked all the .shader files for encoding with Notepad++, they all seemed to be using either UTF-8 or UTF-8 with no BOM. I converted all of them to UTF-8 with no BOM just to make sure, but it didn’t fix the problem.