If your ShaderFX swatch does not compile, select Settings > Show Swatch Compile Errors, then click the Render Swatch icon, and inspect the errors that appear in the ShaderFX editor window.
To see the viewport compile errors, set the environment variable: MAYA_VP2_WANT_OGS_WARNINGS =1 and inspect the errors that appear in the Maya Output Window.