Unity 2019.3.9f1 WebGL build error TypeLoadException when making release build

I’m using Unity 2019.3.9f1, and my build settings are as follows:

156929-fhwsiru.png


When I start a build, it gets to about 90% before failing, with 3 errors logged in the console:



Here is the full stacktrace for each of these errors:


--- ERROR 1 ---
TypeLoadException: Type UnityEditor.WebGL.Il2Cpp.WebGlIl2CppPlatformProvider has invalid vtable method slot 22 with method UnityEditorInternal.BaseIl2CppPlatformProvider:CreateUnityLinkerPlatformProvider ()
UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:930)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <bf679006b1b84db2a5a44842ef13dc36>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <bf679006b1b84db2a5a44842ef13dc36>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

--- ERROR 2 ---
Build completed with a result of 'Failed' in 5 seconds (5492 ms)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

--- ERROR 3 ---
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bb] in <bf679006b1b84db2a5a44842ef13dc36>:0 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <bf679006b1b84db2a5a44842ef13dc36>:0 
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

I have no clue how to proceed from here, and Googling has given me a lot of similar looking errors that are different enough to not apply to me (or, at least, the fixes that worked for their problems didn’t work for me). I do have WebGL module added and installed for this version of unity.

Anyone know how to fix this build issue?

Did you manage to find the answer to this because I am currently having the same issue?

@jakedemian any update? I have the same error? if you manage to overcome the error please share from your experience. thanks

problem fixed here : How To Export Unity Games To WebGL - YouTube