Search Issue Tracker

Fixed

Fixed in 1.5.x

Votes

0

Found in [Package]

1.5.8

Issue ID

LOC-1264

Regression

No

WaitForCompletion exception is thrown in the console when using "LocalizationSettings.StringDatabase.GetTable" method in WebGL

Package: Localization Package

-

How to reproduce:

  1. Open the “LocalizationTest.zip“ project
  2. Build the “SampleScene“ for WebGL
  3. In the Player, open the Developer panel (press the F12 key)
  4. Open the Console tab in the Developer panel and observe it

Expected result: No exception is logged
Actual result: An “Exception: WebGLPlayer does not support synchronous Addressable loading.“ exception is logged

Reproducible in: 1.1.0, 1.5.8 (6000.0.60f1, 6000.2.8f1, 6000.3.0b7, 6000.4.0a3)

Reproduced on: Windows 11 Pro (24H2)
Not reproduced on: No other environment tested

Notes:
- The user reports that the GetLocalizedString method also creates this exception, but locally, the method could not be isolated without using the GetTables method
- The full exception reads “Exception: WebGLPlayer does not support synchronous Addressable loading. Please do not use WaitForCompletion on the WebGLPlayer platform.”
- The WaitForCompletion comes from within the GetTable method
- In Standalone Players and the Editor, this bug does not reproduce

  1. Resolution Note:

    This behavior is actually by design. The synchronous localization APIs, those without “Async” in their names, such as GetTable, rely on synchronous loading. Unfortunately, WebGL does not support synchronous loading, which causes the exception to be thrown via the Addressables system.
    To avoid this issue, we recommend one of the following approaches when working with WebGL:

    - Use the asynchronous versions of the APIs, such as GetTableAsync.
    - Preload the tables before calling any synchronous methods.

    You can find more details in the following documentation:

    https://docs.unity3d.com/Packages/com.unity.addressables@2.7/manual/SynchronousAddressables.html#webgl-support
    https://docs.unity3d.com/Packages/com.unity.localization@1.5/manual/Scripting.html#using-asyncoperationhandle
    https://docs.unity3d.com/Packages/com.unity.localization@1.5/manual/StringTables.html#preloading

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.