Skip to content

WebGL await calls never resolve when using Thirdweb WalletConnect #229

@FedeJIS

Description

@FedeJIS

When using Thirdweb WalletConnect in a Unity WebGL build, I open the WalletConnect modal, but after scanning the QR code and connecting to my wallet, the await calls never properly resolve, causing the wallet connection process to never complete. This issue is likely due to Unity WebGL's lack of threading support, which prevents tasks from being properly awaited.

In the Unity Editor, this works perfectly, but in WebGL builds, it never resolves successfully.

The issue occurs when I call:

await thirdwebManager.ConnectWallet(walletOptions);

Things I Have Tried (Without Success):

  • Using Unity's MainThreadDispatcher
  • Converting async code to IEnumerator coroutines
  • Converting Task methods into UniTask
  • Using WebGLThreadingPatcher

Is there an official way to handle async wallet connections in WebGL, or is there a recommended workaround that does not require bypassing Unity's async system entirely?
I would really appreaciate a solution as I need to use WalletConnect and not MetaMask wallet extensions.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions