WebGL run fails with failed thread creation
See original GitHub issueI’ve built from UnityGLTF from master, added the GLTFComponent
to a scene to load a remote GLTF and disabled multithreading. When I built to WebGL I get the following error. I’ve found that the 1.0.0 release builds and runs in webgl.
Related: #138
SystemException: Thread creation failed.
UnityLoader.js:1043 at System.Threading.Thread.StartInternal (System.Security.Principal.IPrincipal principal, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0
UnityLoader.js:1043 Rethrow as TypeInitializationException: The type initializer for 'System.Threading.Timer.Scheduler' threw an exception.
UnityLoader.js:1043
UnityLoader.js:1043 Rethrow as TypeInitializationException: The type initializer for 'System.Threading.Timer' threw an exception.
UnityLoader.js:1043 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0
UnityLoader.js:1043 --- End of stack trace from previous location where exception was thrown ---
UnityLoader.js:1043 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0
UnityLoader.js:1043 --- End of stack trace from previous location where exception was thrown ---
UnityLoader.js:1043 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0
UnityLoader.js:1043 --- End of stack trace from previous location where exception was thrown ---
UnityLoader.js:1043 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0
UnityLoader.js:1043 --- End of stack trace from previous location where exception was thrown ---
UnityLoader.js:1043 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (2 by maintainers)
Top Results From Across the Web
Unity WebGL issue : Fails to create thread
Code: Select all. SystemException: Thread creation failed. at System.Threading.Thread.Start () [0x00000] in <filename unknown>:0 at Sfs2X.
Read more >System Threading Error using Kii Authentication with Unity ...
I'm creating a WebGL application using Unity written in C#. I have a function that logs the user in based on an authentication...
Read more >Bug - WebGL Build Error
No errors are showing up in the console while running in editor, but as soon as I try to build to WebGL, I...
Read more >"Thread was being aborted" error when generating WebGL ...
Problem You get the following error when using the Create Renditions In Batch command to generate 3D or 2D WebGL viewer files: Thread...
Read more >Error when building WebGl build on linux : r/Unity3D
I'm using Unity on Linux and try to create a WebGl build for my game, but I get the following error message each...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We have a slightly modified version of the app running on WebGL.
You can try this:
Revert
WebRequestLoader.cs
to this version: https://github.com/KhronosGroup/UnityGLTF/blob/83d267f2616585fc8aba5391c003c9a5538ada97/UnityGLTF/Assets/UnityGLTF/Scripts/Loader/WebRequestLoader.csAlter this line https://github.com/KhronosGroup/UnityGLTF/blob/bb189f382697317321a583b22f0aab3692414366/UnityGLTF/Assets/UnityGLTF/Scripts/GLTFComponent.cs#L100 to
loader = new WebRequestLoader(directoryPath, asyncCoroutineHelper);
And this line https://github.com/KhronosGroup/UnityGLTF/blob/ce8485e3b982d1349f1b4b086cba421faf9b11fb/UnityGLTF/Assets/UnityGLTF/Examples/MultiSceneComponent.cs#L24 to
loader = new WebRequestLoader(directoryPath, _asyncCoroutineHelper);
Disable the
Multithreaded
property from theGLTFComponent
.So I have included 2 shaders in the graphics settings