ECS WebGL support

Is it supported at the moment? Using 2019.3.0f3
Right now, the webgl build is crashing at startup.
I have the below relatively simple system. If you look inside CalculateConnectionsJob, I have a one liner there

if(!m_dirtySlotTagType.Exists(entity))
                {
                    m_ecb.AddComponent(index, entity, new DirtySlotConnectionsTag());
                }

If I comment the above, it’s working. Full code and error log from the browser below.

using Unity.Burst;
using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Transforms;
using static Unity.Mathematics.math;

namespace ChaosTech
{
    [BurstCompile]
    public struct DeallocateEntityArrayJob : IJob
    {
        [DeallocateOnJobCompletion]
        public NativeArray<Entity> m_array;

        public void Execute()
        {

        }
    }

    [UpdateAfter(typeof(NewSlotSystem))]
    public class NewSlotSystemECB : EntityCommandBufferSystem
    {

    }

    //[DisableAutoCreation]
    public class NewSlotSystem : JobComponentSystem
    {
        NewSlotSystemECB m_ecbSys;

        EntityQuery m_newSlotsQuery;
        EntityQuery m_existingDirtySlotsQuery;
        EntityQuery m_existingNotDirtySlotsQuery;

        EntityQuery m_dirtyConnectionSlotsQuery;

        protected override void OnCreate()
        {
            base.OnCreate();
            m_ecbSys = World.GetOrCreateSystem<NewSlotSystemECB>();
            m_newSlotsQuery = GetEntityQuery(ComponentType.ReadOnly<NewSlotTag>());

            m_existingDirtySlotsQuery = GetEntityQuery(ComponentType.ReadOnly<Slot>(), ComponentType.ReadOnly<DirtySlotConnectionsTag>(), ComponentType.Exclude<NewSlotTag>());
            m_existingNotDirtySlotsQuery = GetEntityQuery(ComponentType.ReadOnly<Slot>(), ComponentType.Exclude<DirtySlotConnectionsTag>(), ComponentType.Exclude<NewSlotTag>());
            m_dirtyConnectionSlotsQuery = GetEntityQuery(ComponentType.ReadOnly<DirtySlotConnectionsTag>());


            var updateQueryDesc = GetEntityQuery(new EntityQueryDesc
            {
                Any = new ComponentType[] { typeof(DirtySlotConnectionsTag), typeof(NewSlotTag) }
            });
           
            RequireForUpdate(updateQueryDesc);
        }

        [BurstCompile]
        struct NewSlotDirtyNeighboursJob : IJobParallelFor
        {
            public EntityCommandBuffer.Concurrent m_ecb;

            [DeallocateOnJobCompletion]
            public NativeArray<Entity> m_newSlots;

            [DeallocateOnJobCompletion]
            public NativeArray<Entity> m_existingSlots;

            [ReadOnly]
            public ComponentDataFromEntity<Translation> m_translationType;

            public void Execute(int index)
            {
                var ent = m_newSlots[index];
                m_ecb.AddComponent(index, ent, new DirtySlotConnectionsTag());
                m_ecb.RemoveComponent<NewSlotTag>(index, ent);
                var ourPos = m_translationType[ent];

                for (var i = 0; i < m_existingSlots.Length; ++i)
                {
                    var slot = m_existingSlots[i];
                    var pos = m_translationType[slot];
                    var dir = pos.Value - ourPos.Value;
                    if (math.lengthsq(dir) == 1f)
                    {
                        m_ecb.AddComponent(index, slot, new DirtySlotConnectionsTag());
                    }
                }
            }
        }

        [BurstCompile]
        struct CalculateConnectionsJob : IJobForEachWithEntity<Slot>
        {
            public EntityCommandBuffer.Concurrent m_ecb;

            [DeallocateOnJobCompletion]
            public NativeArray<Entity> m_existingSlots;

            [DeallocateOnJobCompletion]
            public NativeArray<Entity> m_newSlots;

            [DeallocateOnJobCompletion]
            public NativeArray<Entity> m_existingNonDirtySlots;

            [ReadOnly]
            public ComponentDataFromEntity<Translation> m_translationType;

            [ReadOnly]
            public ComponentDataFromEntity<DirtySlotConnectionsTag> m_dirtySlotTagType;

            [ReadOnly]
            public ComponentDataFromEntity<NewSlotTag> m_newSlotTagType;
           
            public void Execute(Entity entity, int index, [ReadOnly] ref Slot c0)
            {
                if(!m_dirtySlotTagType.Exists(entity))
                {
                    m_ecb.AddComponent(index, entity, new DirtySlotConnectionsTag());
                }
                /*
                if (m_newSlotTagType.Exists(entity))
                {
                    var ent = m_newSlots[index];
                    m_ecb.AddComponent(index, ent, new DirtySlotConnectionsTag());
                    m_ecb.RemoveComponent<NewSlotTag>(index, ent);
                    var ourPos = m_translationType[ent];

                    for (var i = 0; i < m_existingNonDirtySlots.Length; ++i)
                    {
                        var slot = m_existingNonDirtySlots[i];

                        if(slot == entity)
                        {
                            continue;
                        }

                        var pos = m_translationType[slot];
                        var dir = pos.Value - ourPos.Value;
                        if (math.lengthsq(dir) == 1f && !m_dirtySlotTagType.Exists(slot))
                        {
                            m_ecb.AddComponent(index, slot, new DirtySlotConnectionsTag());
                        }
                    }
                }
                else if (m_dirtySlotTagType.Exists(entity))
                {
                    var ourPos = m_translationType[entity];

                    // connect slots that are one unit appart
                    var conn = m_ecb.AddBuffer<SlotConnection>(index, entity);

                    for (var i = 0; i < m_existingSlots.Length; ++i)
                    {
                        var slot = m_existingSlots[i];
                        var pos = m_translationType[slot];
                        var dir = pos.Value - ourPos.Value;
                        if (math.lengthsq(dir) == 1f)
                        {
                            conn.Add(new SlotConnection() { ConnectionDir = dir, ConnectedSlot = slot });
                        }
                    }
                    m_ecb.RemoveComponent<DirtySlotConnectionsTag>(index, entity);
                }*/
            }
        }

        protected override JobHandle OnUpdate(JobHandle inputDependencies)
        {
            var translationType = GetComponentDataFromEntity<Translation>(true);
            var dirtySlotTagType = GetComponentDataFromEntity<DirtySlotConnectionsTag>(true);
            var newSlotTagType = GetComponentDataFromEntity<NewSlotTag>(true);

            JobHandle calcConnJobHandle;
            {

                var calcConnJob = new CalculateConnectionsJob();
                var count = calcConnJob.CalculateEntityCount(this);

                if (count > 0)
                {
                    /*
                    JobHandle existingSlotArrayJob;
                    var existingSlots = m_existingDirtySlotsQuery.ToEntityArray(Allocator.TempJob, out existingSlotArrayJob);

                    JobHandle newSlotArrayJob;
                    var newSlotTags = m_newSlotsQuery.ToEntityArray(Allocator.TempJob, out newSlotArrayJob);

                    JobHandle existingNotDirtySlotArrayJob;
                    var existingNonDirtySlots = m_existingNotDirtySlotsQuery.ToEntityArray(Allocator.TempJob, out existingNotDirtySlotArrayJob);
                    */

                    var existingSlots = m_existingDirtySlotsQuery.ToEntityArray(Allocator.TempJob);
                    var newSlotTags = m_newSlotsQuery.ToEntityArray(Allocator.TempJob);
                    var existingNonDirtySlots = m_existingNotDirtySlotsQuery.ToEntityArray(Allocator.TempJob);

                    calcConnJob.m_ecb = m_ecbSys.CreateCommandBuffer().ToConcurrent();
                    calcConnJob.m_translationType = translationType;
                    calcConnJob.m_dirtySlotTagType = dirtySlotTagType;
                    calcConnJob.m_newSlotTagType = newSlotTagType;
                    calcConnJob.m_existingSlots = existingSlots;
                    calcConnJob.m_newSlots = newSlotTags;
                    calcConnJob.m_existingNonDirtySlots = existingNonDirtySlots;

                    /*
                    calcConnJobHandle = calcConnJob.Schedule(this, JobHandle.CombineDependencies(
                        JobHandle.CombineDependencies(inputDependencies, existingSlotArrayJob),
                        JobHandle.CombineDependencies(newSlotArrayJob, existingNotDirtySlotArrayJob)
                        ));*/
                    calcConnJobHandle = calcConnJob.Schedule(this, inputDependencies);

                    m_ecbSys.AddJobHandleForProducer(calcConnJobHandle);

                    return calcConnJobHandle;
                }
                else
                {
                    UnityEngine.Debug.Log("no need for job");
                    return inputDependencies;
                }
            }


        }
    }
}
UnityLoader.js:1272 [UnityCache] 'http://localhost:59694/Build/bin.wasm.code.unityweb' successfully downloaded and stored in the indexedDB cache
UnityLoader.js:1272 [UnityCache] 'http://localhost:59694/Build/bin.wasm.framework.unityweb' successfully downloaded and stored in the indexedDB cache
UnityLoader.js:1272 [UnityCache] 'http://localhost:59694/Build/bin.data.unityweb' successfully downloaded and stored in the indexedDB cache
b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 PlayerConnection initialized from  (debug = 0)

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 PlayerConnection disabled  - listening mode not supported

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 Started listening to [0.0.0.0:0]

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 PlayerConnection already initialized - listening to [0.0.0.0:0]

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 Loading player data from data.unity3d

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 Initialize engine version: 2019.3.0f3 (6c9e2bfd6f81)

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 [Subsystems] Discovering subsystems at path UnitySubsystems

UnityLoader.js:1142 Creating WebGL 2.0 context.
b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 Renderer: WebKit WebGL

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 Vendor:   WebKit

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 Version:  OpenGL ES 3.0 (WebGL 2.0 (OpenGL ES 3.0 Chromium))

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 GLES:     3

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443  EXT_color_buffer_float GL_EXT_color_buffer_float EXT_disjoint_timer_query_webgl2 GL_EXT_disjoint_timer_query_webgl2 EXT_float_blend GL_EXT_float_blend EXT_texture_filter_anisotropic GL_EXT_texture_filter_anisotropic KHR_parallel_shader_compile GL_KHR_parallel_shader_compile OES_texture_float_linear GL_OES_texture_float_linear WEBGL_compressed_texture_s3tc GL_WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb GL_WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info GL_WEBGL_debug_renderer_info WEBGL_debug_shaders GL_WEBGL_debug_shaders WEBGL_lose_context GL_WEBGL_lose_context OVR_multiview2 GL_OVR_multiview2

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 OPENGL LOG: Creating OpenGL ES 3.0 graphics device ; Context level  <OpenGL ES 3.0> ; Context handle 27752008

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3517 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
_JS_Sound_Init @ b8e309fb-d86e-47a6-859e-9c0c67a1a462:3517
b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 WARNING: Shader
b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 Unsupported: 'Hidden/Universal Render Pipeline/BokehDepthOfField' - Pass 'Bokeh Depth Of Field CoC' has no vertex shader

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 UnloadTime: 0.445000 ms

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3439 Ignoring invalid [UpdateAfter] attribute on Unity.Scenes.LiveLinkResolveSceneReferenceSystem because Unity.Scenes.SceneSystem belongs to a different ComponentSystemGroup.
This attribute can only order systems that are children of the same ComponentSystemGroup.
Make sure that both systems are in the same parent group with [UpdateInGroup(typeof(Unity.Entities.InitializationSystemGroup)].
You can also change the relative order of groups when appropriate, by using [UpdateBefore] and [UpdateAfter] attributes at the group level.
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
Unity.Debug:LogWarning(String)
Unity.Entities.ComponentSystemSorter:Sort(List`1, GetSystemType`1, Type)
Unity.Entities.ComponentSystemGroup:SortSystemUpdateList()
Unity.Entities.InitializationSystemGroup:SortSystemUpdateList()
Unity.Entities.DefaultWorldInitialization:AddSystemsToRootLevelSystemGroups(World, List`1)
Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
Unity.Entities.AutomaticWorldBootstrap:Initialize()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)


_JS_Log_Dump @ b8e309fb-d86e-47a6-859e-9c0c67a1a462:3439
b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 Input Manager initialize...

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 Input System initialize...

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 [NewInput] Open

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3443 New input system (experimental) initialized

b8e309fb-d86e-47a6-859e-9c0c67a1a462:3519 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
tryToResumeAudioContext @ b8e309fb-d86e-47a6-859e-9c0c67a1a462:3519
b8e309fb-d86e-47a6-859e-9c0c67a1a462:5834 warning: 2 FS.syncfs operations in flight at once, probably just doing extra work
b8e309fb-d86e-47a6-859e-9c0c67a1a462:3439 Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
(Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 554)


_JS_Log_Dump @ b8e309fb-d86e-47a6-859e-9c0c67a1a462:3439
b8e309fb-d86e-47a6-859e-9c0c67a1a462:3519 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
tryToResumeAudioContext @ b8e309fb-d86e-47a6-859e-9c0c67a1a462:3519
24b8e309fb-d86e-47a6-859e-9c0c67a1a462:3439 Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
(Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 554)


_JS_Log_Dump @ b8e309fb-d86e-47a6-859e-9c0c67a1a462:3439
b8e309fb-d86e-47a6-859e-9c0c67a1a462:3519 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
tryToResumeAudioContext @ b8e309fb-d86e-47a6-859e-9c0c67a1a462:3519
37b8e309fb-d86e-47a6-859e-9c0c67a1a462:3439 Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
(Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 554)


_JS_Log_Dump @ b8e309fb-d86e-47a6-859e-9c0c67a1a462:3439
UnityLoader.js:1143 exception thrown: RuntimeError: memory access out of bounds,RuntimeError: memory access out of bounds
    at _malloc (wasm-function[140451]:0x2ce0c8b)
    at __ZN17LowLevelAllocator6MallocEm (wasm-function[14915]:0x5b6c97)
    at __ZN21UnityDefaultAllocatorI17LowLevelAllocatorE8AllocateEmi (wasm-function[14906]:0x5b5f4f)
    at __ZN13MemoryManager8AllocateEmmRK10MemLabelId15AllocateOptionsPKci (wasm-function[5791]:0x25935e)
    at __ZnwmRK10MemLabelIdmPKci (wasm-function[5828]:0x25c929)
    at __ZN23ScriptableRenderContext20ExecuteCommandBufferER22RenderingCommandBuffer (wasm-function[16571]:0x66ff8e)
    at __Z69ScriptableRenderContext_CUSTOM_ExecuteCommandBuffer_Internal_InjectedP30ScriptableRenderContextManagedP12Il2CppObject (wasm-function[17809]:0x6cce42)
    at dynCall_vii (wasm-function[141209]:0x2d0d1a8)
    at Object.dynCall_vii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28610:38)
    at invoke_vii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:18870:24)
    at _ScriptableRenderContext_ExecuteCommandBuffer_Internal_Injected_m93612BE8FA6714852C3CFF474B2699F369DE7C22 (wasm-function[111385]:0x226fcee)
    at dynCall_viii (wasm-function[141240]:0x2d0d539)
    at Object.dynCall_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28765:39)
    at invoke_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19180:25)
    at _ScriptableRenderContext_ExecuteCommandBuffer_Internal_m6BDE1A07FB715DC99F1126AF36DBDDE8C73019D4 (wasm-function[111384]:0x226fc34)
    at dynCall_viii (wasm-function[141240]:0x2d0d539)
    at Object.dynCall_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28765:39)
    at invoke_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19180:25)
    at _ScriptableRenderContext_ExecuteCommandBuffer_m7564285E9D694FADA319BF5BB0A864B2EBF313AF (wasm-function[111414]:0x22708c4)
    at dynCall_viii (wasm-function[141240]:0x2d0d539)
    at Object.dynCall_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28765:39)
    at invoke_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19180:25)
    at _ScriptableRenderer_ExecuteRenderPass_m0D6B07AEC6E539E10B40C12BD9333E79450E1C84 (wasm-function[113792]:0x230ab1d)
    at dynCall_viiiii (wasm-function[141280]:0x2d0da45)
    at Object.dynCall_viiiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28965:41)
    at invoke_viiiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19580:27)
    at _ScriptableRenderer_ExecuteBlock_m921ED8AA8A44EA09DDEA85167224A61590ACE9BF (wasm-function[113788]:0x2309e1e)
    at dynCall_viiiiiii (wasm-function[141296]:0x2d0dc65)
    at Object.dynCall_viiiiiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:29045:43)
    at invoke_viiiiiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19740:29)
    at _ScriptableRenderer_Execute_m962232537F2136EF378FE6019BE399E0125FA242 (wasm-function[113784]:0x2309263)
    at dynCall_viiii (wasm-function[141260]:0x2d0d79a)
    at Object.dynCall_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28865:40)
    at invoke_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19380:26)
    at _UniversalRenderPipeline_RenderSingleCamera_mB5A351767424060BD5E622F972CC830E96B2192D (wasm-function[113916]:0x2313c62)
    at dynCall_viii (wasm-function[141240]:0x2d0d539)
    at Object.dynCall_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28765:39)
    at invoke_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19180:25)
    at _UniversalRenderPipeline_Render_m6465592CA34215951C64EC3C88CF64BE3523DE89 (wasm-function[113912]:0x2312ae7)
    at __ZN18VirtActionInvoker2I47Scene_t942E023788C2BC9FBB7EC8356B4FB0088B2CFED2iE6InvokeEjP12Il2CppObjectS0_i (wasm-function[87297]:0x1ab2daf)
    at dynCall_viiii (wasm-function[141260]:0x2d0d79a)
    at Object.dynCall_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28865:40)
    at invoke_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19380:26)
    at _RenderPipeline_InternalRender_m3601304F718BEEDCC63FAC61AF865392A1B97159 (wasm-function[111219]:0x22698ce)
    at dynCall_viiii (wasm-function[141260]:0x2d0d79a)
    at Object.dynCall_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28865:40)
    at invoke_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19380:26)
    at _RenderPipelineManager_DoRenderLoop_Internal_m3E55159BDC2CB6046ABDF67EA81D7876F159C826 (wasm-function[111261]:0x226b388)
    at __Z178RuntimeInvoker_FalseVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017_VoidU2A_t3A9D5EB5A83DC9C93DF2C4D6EA67B0F5E885889A_RuntimeObject_Int32_t585191389E07734F19F3156FF88FB3EF4800D102PFvvEPK10MethodInfoPvPS4_ (wasm-function[30230]:0xd3226d)
    at dynCall_iiiii (wasm-function[141045]:0x2d0bea5)
printErr @ UnityLoader.js:1143
UnityLoader.js:417 Invoking error handler due to
Uncaught RuntimeError: memory access out of bounds
b8e309fb-d86e-47a6-859e-9c0c67a1a462:9077 Uncaught RuntimeError: memory access out of bounds
    at _malloc (wasm-function[140451]:0x2ce0c8b)
    at __ZN17LowLevelAllocator6MallocEm (wasm-function[14915]:0x5b6c97)
    at __ZN21UnityDefaultAllocatorI17LowLevelAllocatorE8AllocateEmi (wasm-function[14906]:0x5b5f4f)
    at __ZN13MemoryManager8AllocateEmmRK10MemLabelId15AllocateOptionsPKci (wasm-function[5791]:0x25935e)
    at __ZnwmRK10MemLabelIdmPKci (wasm-function[5828]:0x25c929)
    at __ZN23ScriptableRenderContext20ExecuteCommandBufferER22RenderingCommandBuffer (wasm-function[16571]:0x66ff8e)
    at __Z69ScriptableRenderContext_CUSTOM_ExecuteCommandBuffer_Internal_InjectedP30ScriptableRenderContextManagedP12Il2CppObject (wasm-function[17809]:0x6cce42)
    at dynCall_vii (wasm-function[141209]:0x2d0d1a8)
    at Object.dynCall_vii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28610:38)
    at invoke_vii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:18870:24)
    at _ScriptableRenderContext_ExecuteCommandBuffer_Internal_Injected_m93612BE8FA6714852C3CFF474B2699F369DE7C22 (wasm-function[111385]:0x226fcee)
    at dynCall_viii (wasm-function[141240]:0x2d0d539)
    at Object.dynCall_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28765:39)
    at invoke_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19180:25)
    at _ScriptableRenderContext_ExecuteCommandBuffer_Internal_m6BDE1A07FB715DC99F1126AF36DBDDE8C73019D4 (wasm-function[111384]:0x226fc34)
    at dynCall_viii (wasm-function[141240]:0x2d0d539)
    at Object.dynCall_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28765:39)
    at invoke_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19180:25)
    at _ScriptableRenderContext_ExecuteCommandBuffer_m7564285E9D694FADA319BF5BB0A864B2EBF313AF (wasm-function[111414]:0x22708c4)
    at dynCall_viii (wasm-function[141240]:0x2d0d539)
    at Object.dynCall_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28765:39)
    at invoke_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19180:25)
    at _ScriptableRenderer_ExecuteRenderPass_m0D6B07AEC6E539E10B40C12BD9333E79450E1C84 (wasm-function[113792]:0x230ab1d)
    at dynCall_viiiii (wasm-function[141280]:0x2d0da45)
    at Object.dynCall_viiiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28965:41)
    at invoke_viiiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19580:27)
    at _ScriptableRenderer_ExecuteBlock_m921ED8AA8A44EA09DDEA85167224A61590ACE9BF (wasm-function[113788]:0x2309e1e)
    at dynCall_viiiiiii (wasm-function[141296]:0x2d0dc65)
    at Object.dynCall_viiiiiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:29045:43)
    at invoke_viiiiiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19740:29)
    at _ScriptableRenderer_Execute_m962232537F2136EF378FE6019BE399E0125FA242 (wasm-function[113784]:0x2309263)
    at dynCall_viiii (wasm-function[141260]:0x2d0d79a)
    at Object.dynCall_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28865:40)
    at invoke_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19380:26)
    at _UniversalRenderPipeline_RenderSingleCamera_mB5A351767424060BD5E622F972CC830E96B2192D (wasm-function[113916]:0x2313c62)
    at dynCall_viii (wasm-function[141240]:0x2d0d539)
    at Object.dynCall_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28765:39)
    at invoke_viii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19180:25)
    at _UniversalRenderPipeline_Render_m6465592CA34215951C64EC3C88CF64BE3523DE89 (wasm-function[113912]:0x2312ae7)
    at __ZN18VirtActionInvoker2I47Scene_t942E023788C2BC9FBB7EC8356B4FB0088B2CFED2iE6InvokeEjP12Il2CppObjectS0_i (wasm-function[87297]:0x1ab2daf)
    at dynCall_viiii (wasm-function[141260]:0x2d0d79a)
    at Object.dynCall_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28865:40)
    at invoke_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19380:26)
    at _RenderPipeline_InternalRender_m3601304F718BEEDCC63FAC61AF865392A1B97159 (wasm-function[111219]:0x22698ce)
    at dynCall_viiii (wasm-function[141260]:0x2d0d79a)
    at Object.dynCall_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:28865:40)
    at invoke_viiii (blob:http://localhost:59694/b8e309fb-d86e-47a6-859e-9c0c67a1a462:19380:26)
    at _RenderPipelineManager_DoRenderLoop_Internal_m3E55159BDC2CB6046ABDF67EA81D7876F159C826 (wasm-function[111261]:0x226b388)
    at __Z178RuntimeInvoker_FalseVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017_VoidU2A_t3A9D5EB5A83DC9C93DF2C4D6EA67B0F5E885889A_RuntimeObject_Int32_t585191389E07734F19F3156FF88FB3EF4800D102PFvvEPK10MethodInfoPvPS4_ (wasm-function[30230]:0xd3226d)
    at dynCall_iiiii (wasm-function[141045]:0x2d0bea5)
1 Like

And the log for the “Internal: JobTempAlloc has allocations that are more than 4 frames old…” entry, when I expand it in the browser console, seems like a call stack

8c296607-a449-4e89-a3e2-63fac16e648e:3439 Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
(Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 554)
2 Likes

Somewhat false alarm, I think below is a memory leak, but not the cause. I disabled the audio listener in the scene on my camera and the issue below disappeared. So i’m still looking for the real cause

Old comment:
Could it have something to do with the way Unity implements Audio in WebGL? That seems to be a leak, if I’m reading Chrome profiler correctly. I’m new with profiling in browser.

1 Like

Hi, this issue is blocking my company moving forward with WebGL, submitted a bug report as well but no reply. Can someone please suggest the way forward?

2 Likes

As I understand it now, project TIny may be the best current approach to use dots in the browser. Since it’s at least their main focus. Is there a possibility for you to experiment with that? There’s a dedicated Tiny forum as well for you to post in.

1 Like

Thanks for the reply, but unless I misunderstand, Tiny is 2D only

And 3D look at tiny race sample.

2 Likes

Holy Crap!

1 Like

Any updates on this please? Is the WebGL target supported in ECS Hybrid (with gameobjects)?

1 Like

In the package manager there’s a DOTS build option for webgl so it looks like this is at least intended to be possible now.

1 Like

I have a scene with some GameObjects with ConvertToEntity. Basic stuff, some cubes and some spheres. The spheres have unity dots physics on them, and they just fall down on a plane at startup. I do a classic build using the scriptable build pipeline, webgl target. When I run it in Chrome, I get the bellow error. Any ideas?

e4c48cb5-1327-488d-af3c-2c9990260db4:3436 NotSupportedException: To marshal a managed method, please add an attribute named 'MonoPInvokeCallback' to the method definition. The method we're attempting to marshal is: Unity.Entities.StructuralChange::AddComponentEntitiesBatchExecute
  at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegateInternal (System.Delegate d) [0x00000] in <00000000000000000000000000000000>:0
  at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate (System.Delegate d) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Burst.BurstCompiler.Compile[T] (T delegateObj, System.Boolean isFunctionPointer) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Burst.BurstCompiler.CompileFunctionPointer[T] (T delegateMethod) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.StructuralChange.Initialize () [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.EntityManager..ctor (Unity.Entities.World world) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.World..ctor (System.String name) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.DefaultWorldInitialization.Initialize (System.String defaultWorldName, System.Boolean editorWorld) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.AutomaticWorldBootstrap.Initialize () [0x00000] in <00000000000000000000000000000000>:0
(Filename: currently not available on il2cpp Line: -1)

My build settings:

1 Like

Seems like it’s still pretty broken. I tried it with the latest packages, running 2019.3.06f. I’m trying to run a fairly simple project and it immediately errors out at runtime:
5425761--552114--chrome_RHomXqg4hf.png

Log:

UnityLoader.js:3 You can reduce your startup time if you configure your web server to host .unityweb files using gzip compression.
UnityLoader.js:4 [UnityCache] 'http://localhost:59839/Build/Part3Webgl.wasm.code.unityweb' successfully downloaded and stored in the indexedDB cache
UnityLoader.js:4 [UnityCache] 'http://localhost:59839/Build/Part3Webgl.wasm.framework.unityweb' successfully downloaded and stored in the indexedDB cache
UnityLoader.js:4 [UnityCache] 'http://localhost:59839/Build/Part3Webgl.data.unityweb' successfully downloaded and stored in the indexedDB cache
9f591032-de67-426b-b559-440c10248002:8 Loading player data from data.unity3d

9f591032-de67-426b-b559-440c10248002:8 Initialize engine version: 2019.3.0f6 (27ab2135bccf)

9f591032-de67-426b-b559-440c10248002:8 [Subsystems] Discovering subsystems at path UnitySubsystems

UnityLoader.js:4 Creating WebGL 2.0 context.
9f591032-de67-426b-b559-440c10248002:8 Renderer: WebKit WebGL

9f591032-de67-426b-b559-440c10248002:8 Vendor:   WebKit

9f591032-de67-426b-b559-440c10248002:8 Version:  OpenGL ES 3.0 (WebGL 2.0 (OpenGL ES 3.0 Chromium))

9f591032-de67-426b-b559-440c10248002:8 GLES:     3

9f591032-de67-426b-b559-440c10248002:8  EXT_color_buffer_float GL_EXT_color_buffer_float EXT_disjoint_timer_query_webgl2 GL_EXT_disjoint_timer_query_webgl2 EXT_float_blend GL_EXT_float_blend EXT_texture_filter_anisotropic GL_EXT_texture_filter_anisotropic KHR_parallel_shader_compile GL_KHR_parallel_shader_compile OES_texture_float_linear GL_OES_texture_float_linear WEBGL_compressed_texture_s3tc GL_WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb GL_WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info GL_WEBGL_debug_renderer_info WEBGL_debug_shaders GL_WEBGL_debug_shaders WEBGL_lose_context GL_WEBGL_lose_context OVR_multiview2 GL_OVR_multiview2

9f591032-de67-426b-b559-440c10248002:8 OPENGL LOG: Creating OpenGL ES 3.0 graphics device ; Context level  <OpenGL ES 3.0> ; Context handle 23713856

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. <URL>
9f591032-de67-426b-b559-440c10248002:8 WARNING: Shader
9f591032-de67-426b-b559-440c10248002:8 Unsupported: 'Hidden/Universal Render Pipeline/BokehDepthOfField' - Pass 'Bokeh Depth Of Field CoC' has no vertex shader

9f591032-de67-426b-b559-440c10248002:8 UnloadTime: 0.300001 ms

9f591032-de67-426b-b559-440c10248002:8 NotSupportedException: To marshal a managed method, please add an attribute named 'MonoPInvokeCallback' to the method definition. The method we're attempting to marshal is: Unity.Entities.StructuralChange::AddComponentEntitiesBatchExecute

(Filename: currently not available on il2cpp Line: -1)


_JS_Log_Dump @ 9f591032-de67-426b-b559-440c10248002:8
9f591032-de67-426b-b559-440c10248002:8 ConvertToEntity failed because there is no DefaultGameObjectInjectionWorld
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)


_JS_Log_Dump @ 9f591032-de67-426b-b559-440c10248002:8
9f591032-de67-426b-b559-440c10248002:8 ConvertToEntity failed because there is no DefaultGameObjectInjectionWorld
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)


_JS_Log_Dump @ 9f591032-de67-426b-b559-440c10248002:8
UnityLoader.js:4 Not implemented: Class::FromIl2CppType
9f591032-de67-426b-b559-440c10248002:8 MethodAccessException: Attempt to access the method failed.

(Filename: currently not available on il2cpp Line: -1)


_JS_Log_Dump @ 9f591032-de67-426b-b559-440c10248002:8
9f591032-de67-426b-b559-440c10248002:8 Input Manager initialize...

9f591032-de67-426b-b559-440c10248002:8 Input System initialize...

9f591032-de67-426b-b559-440c10248002:8 [NewInput] Open

9f591032-de67-426b-b559-440c10248002:8 New input system (experimental) initialized

UnityLoader.js:4 exception thrown: RuntimeError: memory access out of bounds,RuntimeError: memory access out of bounds
    at wasm-function[67735]:0x123f6d4
    at wasm-function[13434]:0x57c88d
    at wasm-function[52656]:0xe8a912
    at wasm-function[26470]:0x9ebb58
    at wasm-function[43527]:0xcafaf1
    at wasm-function[43538]:0xcb03d9
    at wasm-function[36376]:0xb52977
    at wasm-function[60924]:0x1088fbb
    at wasm-function[21866]:0x96c001
    at wasm-function[67762]:0x123fb21
    at Object.dynCall_iiiii (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:470933)
    at invoke_iiiii (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:335626)
    at wasm-function[65859]:0x11eacc5
    at wasm-function[65304]:0x11d1b2b
    at wasm-function[4147]:0x1af97b
    at wasm-function[4146]:0x1af8a4
    at wasm-function[7798]:0x2edc2a
    at wasm-function[7795]:0x2eca4c
    at wasm-function[10182]:0x3eb33a
    at wasm-function[8057]:0x30b399
    at wasm-function[10567]:0x416e5a
    at wasm-function[10278]:0x3f3f27
    at wasm-function[10278]:0x3f3f3c
    at wasm-function[10272]:0x3f3a41
    at wasm-function[10266]:0x3f1b7b
    at wasm-function[67781]:0x123fe51
    at Object.dynCall_v (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:481150)
    at browserIterationFunc (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:173433)
    at Object.runIter (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:176494)
    at Browser_mainLoop_runner (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:174956)
printErr @ UnityLoader.js:4
UnityLoader.js:3 Invoking error handler due to
Uncaught RuntimeError: memory access out of bounds
9f591032-de67-426b-b559-440c10248002:8 Uncaught RuntimeError: memory access out of bounds
    at wasm-function[67735]:0x123f6d4
    at wasm-function[13434]:0x57c88d
    at wasm-function[52656]:0xe8a912
    at wasm-function[26470]:0x9ebb58
    at wasm-function[43527]:0xcafaf1
    at wasm-function[43538]:0xcb03d9
    at wasm-function[36376]:0xb52977
    at wasm-function[60924]:0x1088fbb
    at wasm-function[21866]:0x96c001
    at wasm-function[67762]:0x123fb21
    at Object.dynCall_iiiii (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:470933)
    at invoke_iiiii (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:335626)
    at wasm-function[65859]:0x11eacc5
    at wasm-function[65304]:0x11d1b2b
    at wasm-function[4147]:0x1af97b
    at wasm-function[4146]:0x1af8a4
    at wasm-function[7798]:0x2edc2a
    at wasm-function[7795]:0x2eca4c
    at wasm-function[10182]:0x3eb33a
    at wasm-function[8057]:0x30b399
    at wasm-function[10567]:0x416e5a
    at wasm-function[10278]:0x3f3f27
    at wasm-function[10278]:0x3f3f3c
    at wasm-function[10272]:0x3f3a41
    at wasm-function[10266]:0x3f1b7b
    at wasm-function[67781]:0x123fe51
    at Object.dynCall_v (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:481150)
    at browserIterationFunc (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:173433)
    at Object.runIter (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:176494)
    at Browser_mainLoop_runner (blob:http://localhost:59839/9f591032-de67-426b-b559-440c10248002:8:174956)
1 Like

Getting ecs to work in the browser without Tiny is a bit more involved. It’s not an officially supported target at the moment.
I made a sample with explanation and created a thread, check it out here:
https://forum.unity.com/threads/dots-hybrid-sample-for-the-wasm-browser-target.812331/#post-5387988

2 Likes

Is there an existing ticket, or is it worth raising one? I’ve attempted a web-gl build of a working Windows build that uses ECS and while it does start the title (no ECS), as soon as it begins the game scene (with ECS), it crashes with index-out-of-bound errors in the player loop just iterating through systems.

(as an aside, I was getting crashes using il2cpp while Mono appears to work fine standalone)

edit: “WebGL and Burst compatibility should be hopefully fixed later this year, but we don’t have any precise ETA at the moment.” ( Burst for standalone players page-5#post-5364648)

2 Likes

Brilliant, thank you spacey!