Could Not Load AtomicSafetyHandle For WebGL macOS,Could not load type AtomicSafetyHandle error in WebGL MacOS

Hi, I’m new to unity and I have a basic project that works well when compiled for a desktop platform, but when I switch to WebGL, I’m getting the following error:

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'.

I’m using Unity 2021.2.3f1, in a MacOS Monterey (v12.0.1) with M1 Chip.

I’m attaching the editor log for more info => [189189-editor-log.txt|189189]

Any help would be much appreciated.

Thanks.

@Okeir Did you ever solve this? I have the same issue.,@Okeir DId you ever solve this? I am having the same issue.

Did anyone find any solution?

Are you using Entities?

same issue here. i am on a mac m1 too. please help

This happens after Publishing for WebGL. WebGL is a platform for publishing where the build target is meant to be executed in-browser (WebAssembly, WebGL based). Therefore, after building for WebGL, the platform is still set to WebGL. If you want to test locally (therefore build it), the platform needs to be changed again.

You need to go back to platform Windows, Mac, Linux so File → Build Settings… → Then in the lower part of the window, select Windows, Mac, Linux and click “Switch platform”. After that you can Run the project again.

I’m having the same issue. Has anyone found a solution yet?
Unfortunately the proposal by @fluctura won’t work, because it still doesn’t allow me to publish in WebGL.