WebGLThreadingPatcher
WebGLThreadingPatcher copied to clipboard
WebGL build fails with this package installed
Hi, I have unity 2023.2.9f1 and when I install WebGLThreading Patcher my WebGL build fails with the following error:
IL2CPP error for method 'System.Void System.Threading.<>_GenericWrapper::.ctor(System.Action1<T>)' in assembly '[projectpath]\Library\Bee\artifacts\WebGL\ManagedStripped\mscorlib.dll System.InvalidOperationException: Attempting to return from void method 'System.Void System.Threading.<>_GenericWrapper::.ctor(System.Action1<T>)' when there are values on the stack. Is this invalid IL code
Any ideas how to fix that ?
Here's the fix.
https://github.com/RageAgainstThePixel/com.utilities.async/pull/13/files#diff-3c2a243f73942f45e9f92906a31b6ad885205bae85be6e88bc4c90cae5754075R165
Here's the fix.
https://github.com/RageAgainstThePixel/com.utilities.async/pull/13/files#diff-3c2a243f73942f45e9f92906a31b6ad885205bae85be6e88bc4c90cae5754075R165
Cool thanks !
Here's the fix.
https://github.com/RageAgainstThePixel/com.utilities.async/pull/13/files#diff-3c2a243f73942f45e9f92906a31b6ad885205bae85be6e88bc4c90cae5754075R165
@StephenHodgson Well ... not sure what the fix should be ? I installed your Utilities.async package but it doesnt fix the WebGL Threading patcher build error .... so I thought it is more like a replacement than fix, uninstalled WebGL Threading patcher, but then await methods are not awaited in webGL
Here's the fix. https://github.com/RageAgainstThePixel/com.utilities.async/pull/13/files#diff-3c2a243f73942f45e9f92906a31b6ad885205bae85be6e88bc4c90cae5754075R165
@StephenHodgson Well ... not sure what the fix should be ? I installed your Utilities.async package but it doesnt fix the WebGL Threading patcher build error .... so I thought it is more like a replacement than fix, uninstalled WebGL Threading patcher, but then await methods are not awaited in webGL
Really? Bc I ran into the same exact build error, and needed fixing for one of my other popular packages.
@StephenHodgson Thank you for the fast response. Just to be sure that I understand everything well ... installing your package should fix that WebGL Threading Patcher right ? So the install process should be:
- Install WebGL Threading Patcher ( will throw that IL2CPP error )
- Install Utilities.Async
... done, error goes away and the build is now flawless ? Does the order of those 2 steps matter ? Nothing else needs to be done/setup and the build should now work with WebGL Threading Patcher installed ?
@StephenHodgson Thank you for the fast response. Just to be sure that I understand everything well ... installing your package should fix that WebGL Threading Patcher right ? So the install process should be:
- Install WebGL Threading Patcher ( will throw that IL2CPP error )
- Install Utilities.Async
... done, error goes away and the build is now flawless ? Does the order of those 2 steps matter ? Nothing else needs to be done/setup and the build should now work with WebGL Threading Patcher installed ?
You only need Utilities.Async from OpenUPM. WebGL thread patcher is already part of my package as post build step.
@StephenHodgson Ok so I would call it more of a replacement than a fix. Do I need any tweaks to my code for it to work ? As typicall "var result = await function();" seems to never end awaiting for some specific methods ( Evm.ContractSend in that case ) which are probably interacting with javascript or something under the hood. Hard to say as its compiled into dll.
But the exact same line of code finished correctly on older unity version with original WebGL Threading Patcher. I had to switch to more recent version because of other WebGL stuff support unfortunatelly.
? As typicall "var result = await function();" seems to never end awaiting for some specific method
Sounds like those are blocking calls.
exact same line of code finished correctly on older unity version with original WebGL Threading Patcher
Sure but keep in mind, according to the Unity engineer, the call stacks have always been misaligned and broken. Which was causing some other undefined behavior. So I guess pick your poison.
@StephenHodgson Ok, thank you for your time and willingess then.