webgl exception

hi,
i started a testscene with just 2 spheres and an unlit material. on webgl-export i get the compiler error:

Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.

at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)

at System.Reflection.Assembly.GetTypes () [0x00000] in :0

at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in :0

at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in :0

at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in :0

at Mono.CSharp.Driver.LoadReferences () [0x00000] in :0

at Mono.CSharp.Driver.Compile () [0x00000] in :0

at Mono.CSharp.Driver.Main (System.String[ ] args) [0x00000] in :0

any ideas?

thx for help :slight_smile:

Hello,

could you please submit the faulty project using the bug reporter and paste the case number here? We will look at it as soon as we can and fix it for one of the upcoming betas.

Thanks,
Gabriele

thanks for the reply, the casenumber is 644059

Thanks!

After investigating this bug, it looks like the PlayMaker code is trying to use UnityEngine.NetworkPlayer, which is not supported in WebGL. Unity is not doing a very good job of reporting the error, IMO. If I dig into the Editor.log file, just above the TypeLoadException, I see this:

-----CompilerOutput:-stdout–exitcode: 1–compilationhadfailure: True–outfile: Temp/Assembly-CSharp.dll
The class UnityEngine.NetworkPlayer could not be loaded, used in UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
The class HutongGames.PlayMaker.FsmEventData could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
The class HutongGames.PlayMaker.Fsm could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
The class HutongGames.PlayMaker.Fsm could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
The class HutongGames.PlayMaker.FsmState could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
The class HutongGames.PlayMaker.Fsm could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
The class BitConverter could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
The class HutongGames.PlayMaker.FsmStateAction could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
The class HutongGames.PlayMaker.Fsm could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
The class PlayMakerFSM could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null
The class PlayMakerFSM could not be loaded, used in PlayMaker, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null

In the PlayMaker code, this access to UnityEngine.NetworkPlayer is usually inside a #if like this:

#if !(UNITY_FLASH || UNITY_NACL || UNITY_METRO || UNITY_WP8)

I think that the code should be changed to this:

#if !(UNITY_FLASH || UNITY_NACL || UNITY_METRO || UNITY_WP8 || UNITY_WBEGL)

simply adding UNITY_WEBGL to the list of exclusions.

So at least initially, I don’t think this is a bug we can correct on the Unity side.

thanks for your help!

@kryptopath2 Are you using the Playmaker 1.8.0 beta? Did you import PlayMakerNACL.unitypackage into your test project? Networking is stripped from that version. All actions should already have UNITY_WEBGL in the list of exclusions…