Unable to build on MacOS targeting WebGL.
Description
I added this Netcode package to an empty project targeting WebGL on MacOS platform. I realize that the default transport, UTP, does not work on WebGL. I am planning on using a WebSocket based community transport. However, this should not prevent compilation. Upon loading the package, I see several of the following error:
(0,0): error System.TypeLoadException: Could not load type 'Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle' from assembly 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Reproduce Steps
- Ensure you're on MacOS.
- Import package into an empty Unity project.
- Target WebGL.
Alternatively, simply load the attached sample project below on a MacOS device.
Actual Outcome
Several errors listed, all the same error:
(0,0): error System.TypeLoadException: Could not load type 'Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle' from assembly 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Expected Outcome
Project can be built without errors.
Environment
- OS: MacOS Big Sur 11.6.4
- Unity Version: 2021.2.18f1
- Netcode Version: 1.0.0-pre.9
- Netcode Commit: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/cdca1eb844973e9f314f6a263bb4c0497d9e396f
Additional Context
See sample project: https://drive.google.com/file/d/1n_Z8w-dv49oTu8I-j8XJloeNmfhi7ZJ-/view?usp=sharing
Tracked in our backlog MTT-4088
This should be fixed with https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/2199
UTP support for WebSocket should also be available soon.