- Home /
No builtin shaders in Linux command line WebGL build
I'm trying to build a WebGL project on a Linux VM. The build is successful and the project otherwise works, but none of the builtin shaders seem to work, not even the error shader. So anything with a builtin shader does not appear in the scene at all and the console is full of errors like this:
"The resource Internal-ErrorShader.shader could not be loaded from the resource file!"
Objects from the Asset Store, which have their own shaders, show up ok.
The problem also appears with a freshly create new project with only a cube added to the scene.
The same project works ok if built in Windows command-line.
The build log doesn't appear to contain any errors.
My command line is
Unity
-batchmode
-nographics
-logfile
-projectPath
testproject
-executeMethod
MyBuilder.WebGLBuilder.build
-quit
The WebGLBuilder.cs contains
using UnityEditor;
namespace MyBuilder
{
public class WebGLBuilder
{
[MenuItem("Build/Build MyWebGL")]
public static void build()
{
string[] scenes = { "Assets/Scenes/GameScene.unity" };
BuildPipeline.BuildPlayer(scenes, "Build", BuildTarget.WebGL, BuildOptions.None);
}
}
}
I'm using Unity 2021.3.0f1.
Your answer
![](https://koobas.hobune.stream/wayback/20220613055534im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
WebGL build size is much smaller compared to PC build size 0 Answers
WebGL Build Failing Linux 0 Answers
Build Unity Game using linux server 0 Answers
WebGL build error Linux 0 Answers
WebGL build not working on linux 1 Answer