WebGL build fails from command line
Trying to run batchmode to produce a WebGL build ends up producing nothing. The only thing that resembles an error in the logfile is this:
IndexOutOfRangeException: Array index is out of range. UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:898) UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:272) UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions) JetpackSkies.AutoBuilder:BuildHTML5Facebook() (at Assets/Editor/AutoBuilder.cs:56)
The only command I'm executing to kick the build off is this:
BuildPipeline.BuildPlayer(new string[] { "Assets/GameScene.unity" }, "HTML5", BuildTarget.WebGL, BuildOptions.None);
I'm not sure what the issue with the out-of-bounds index is, since I don't think I have any way to see into BuildPostprocessor.cs
My current Unity version is 2017.3.0p1
Answer by ShooterMG · Jan 02, 2018 at 04:27 PM
Looks like the issue is with using a custom HTML template. When I use one of the built-in HTML templates, everything compiles fine. Not sure what the issue is with the custom template, but this thread can be closed.
Not really. You narrowed down the issue to using the custom template, that's great, but that doesn't solve the issue. If a custom template was used, in most cases it was needed.
Your answer

Follow this Question
Related Questions
C# to WebGL 2 Answers
WebGL issue - Release Build triggers error, Development Build runs fine 0 Answers
How to Make Proper Font used in WebGL build? 2 Answers
Pass mouseevents from Iframe to unity application (WebGL) 0 Answers
Limiting frame rate (fps) in my game isn't working. (dev. for WebGL) 0 Answers