The Assembly UnityEngine.WebGLModule is referenced by UnityEngine but the dll is not allowed to be included or could not be found

ArgumentException: The Assembly UnityEngine.WebGLModule is referenced by UnityEngine (‘C:/Program Files/Unity/Hub/Editor/2020.3.19f1/Editor/Data/PlaybackEngines/WebGLSupport/Managed/UnityEngine.dll’). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at <97ba64834c8f4edc84e3d8e30b04f122>:0)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String paths, System.String foldersToSearch, UnityEditor.BuildTarget target) (at <97ba64834c8f4edc84e3d8e30b04f122>:0)
UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions)
Unity.Play.Publisher.Editor.PublisherBuildProcessor:OpenBuildGameDialog(BuildTarget) (at Library/PackageCache/com.unity.connect.share@4.1.1/Editor/PublisherBuildProcessor.cs:180)
Unity.Play.Publisher.Editor.PublisherWindow:OnWebGLBuildTargetSet() (at Library/PackageCache/com.unity.connect.share@4.1.1/Editor/PublisherWindow.cs:734)
Unity.Play.Publisher.Editor.PublisherWindow:OnCreateABuildClicked() (at Library/PackageCache/com.unity.connect.share@4.1.1/Editor/PublisherWindow.cs:509)
Unity.Play.Publisher.Editor.<>c__DisplayClass75_0:b__0() (at Library/PackageCache/com.unity.connect.share@4.1.1/Editor/PublisherWindow.cs:627)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Hi!

Are you trying to build the game to a folder inside the assets folder? I tried to do this a while ago and you can’t because it tries to build the assets and if you include the game within those assets then it breaks. The error says that it cannot be included or found so I think it is talking about the build destination.

Hope this helps!