Cant build WebGL with 2021.3.15f1 and previous!

Oke so me again. again with problems.
i have the same game i had in before nothing changed. had to swithc to 2021.3.11f in order to make APK’s for my game cause it was not working on 2020 versions…

now in these versions i cant build WEBGL… how do i fix this ?

when i try to build with 2021.3.15f1 i get these errrors i also tried to make with other 2021 versions no success…

ERRORS:

FIRST:
ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: subshaderIndex
UnityEngine.Shader.FindSubshaderTagValue (System.Int32 subshaderIndex, UnityEngine.Rendering.ShaderTagId tagName) (at <685c48cf8f0b48abb797275c046dda6a>:0)
UnityEditor.Rendering.BuiltIn.ShaderPreprocessor.IsShaderGraphShader (UnityEngine.Shader shader, UnityEditor.Rendering.ShaderSnippetData snippetData) (at Library/PackageCache/com.unity.shadergraph@12.1.8/Editor/Generation/Targets/BuiltIn/Editor/ShaderPreprocessor.cs:114)
UnityEditor.Rendering.BuiltIn.ShaderPreprocessor.StripUnused (UnityEditor.Rendering.BuiltIn.ShaderFeatures features, UnityEngine.Shader shader, UnityEditor.Rendering.ShaderSnippetData snippetData, UnityEditor.Rendering.ShaderCompilerData compilerData) (at Library/PackageCache/com.unity.shadergraph@12.1.8/Editor/Generation/Targets/BuiltIn/Editor/ShaderPreprocessor.cs:284)
UnityEditor.Rendering.BuiltIn.ShaderPreprocessor.OnProcessShader (UnityEngine.Shader shader, UnityEditor.Rendering.ShaderSnippetData snippetData, System.Collections.Generic.IList`1[T] compilerDataList) (at Library/PackageCache/com.unity.shadergraph@12.1.8/Editor/Generation/Targets/BuiltIn/Editor/ShaderPreprocessor.cs:348)
UnityEditor.Build.BuildPipelineInterfaces.OnPreprocessShaders (UnityEngine.Shader shader, UnityEditor.Rendering.ShaderSnippetData snippet, UnityEditor.Rendering.ShaderCompilerData[ ] data) (at <63965ae56af7489797f355b7c1211ab2>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

SECOND:

Error building Player: ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: subshaderIndex

Third:
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <63965ae56af7489797f355b7c1211ab2>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <63965ae56af7489797f355b7c1211ab2>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

THanks hoping to get fast respons!

Also, get the same error on Mobile APK builds… grate work lads :slight_smile:

Shader error in ‘’: Parse error: syntax error, unexpected $end at line 380
Shader error in ‘’: Parse error: Block comment not closed (EOF in comment) at line 380

anyways i got this error away now i have the same one as for WEBGL

ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: subshaderIndex
UnityEngine.Shader.FindSubshaderTagValue (System.Int32 subshaderIndex, UnityEngine.Rendering.ShaderTagId tagName) (at <685c48cf8f0b48abb797275c046dda6a>:0)
UnityEditor.Rendering.BuiltIn.ShaderPreprocessor.IsShaderGraphShader (UnityEngine.Shader shader, UnityEditor.Rendering.ShaderSnippetData snippetData) (at Library/PackageCache/com.unity.shadergraph@12.1.8/Editor/Generation/Targets/BuiltIn/Editor/ShaderPreprocessor.cs:114)
UnityEditor.Rendering.BuiltIn.ShaderPreprocessor.StripUnused (UnityEditor.Rendering.BuiltIn.ShaderFeatures features, UnityEngine.Shader shader, UnityEditor.Rendering.ShaderSnippetData snippetData, UnityEditor.Rendering.ShaderCompilerData compilerData) (at Library/PackageCache/com.unity.shadergraph@12.1.8/Editor/Generation/Targets/BuiltIn/Editor/ShaderPreprocessor.cs:284)
UnityEditor.Rendering.BuiltIn.ShaderPreprocessor.OnProcessShader (UnityEngine.Shader shader, UnityEditor.Rendering.ShaderSnippetData snippetData, System.Collections.Generic.IList`1[T] compilerDataList) (at Library/PackageCache/com.unity.shadergraph@12.1.8/Editor/Generation/Targets/BuiltIn/Editor/ShaderPreprocessor.cs:348)
UnityEditor.Build.BuildPipelineInterfaces.OnPreprocessShaders (UnityEngine.Shader shader, UnityEditor.Rendering.ShaderSnippetData snippet, UnityEditor.Rendering.ShaderCompilerData[ ] data) (at <63965ae56af7489797f355b7c1211ab2>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

I’m getting this error too when I build to Android aab. No idea what to do, any fix for this or what?

well i switched back to 2021.3.11f1 and the error is gone … now it just crashes at initial start… what a disaster…

1 Like

Interesting. Were you able to build it out without any issues though?

Just as a best practice, make sure you do a “Clean Build” / Delete the IL2CPP cache whenever you switch editor version. Better yet, just delete the library folder.

Not saying this is the issue but it can be a symptom of that.

1 Like

Ok, I was finally able to build when downgrading to 2021.3.11f1 and I found out it was due to the Shader Graph being at 12.1.8. When you downgrade to 3.11f1, it rolls back shader graph to 12.1.7 and the build works just fine. Thanks for the suggestion gatisp09!

no problem

It happen to me in 2021.3.15 but works in 2021.3.14 anyone know what shader is the problem?

i did it but is not working >.<

Bumping here

I have the exact same issue, build failed "
Error building Player: ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: subshaderIndex"

I just updated to 2021.3.16f1 …
Was on 2021.3.14f1 before and all was good

1 Like

wow i just thinking about udpate to .16 so still the same issue, the problem is the shader, i havent found what shader its, because i got another project working fine under .15

I cannot find which shader either, Unity doesn’t even tell you that in the error so we’re blind…

1 Like