Remote Config works for desktop but doesn't work for WebGL build.

Unity 2020.2.0f1
Unity Collaborate 1.3.9
Remote Config 2.0.1

FetchCompleted configResponse status is Success in Editor and Windows build but configResponse status is Fail for WebGL build uploaded to my hosting.

        void Awake()
        {
            ConfigManager.FetchCompleted += FetchCompleted;

            ConfigManager.SetEnvironmentID("7e3a90d6-32ea-414b-b760-cda48df4078f");

            ConfigManager.FetchConfigs<UserAttributes, AppAttributes>(new UserAttributes(), new AppAttributes());
        }

        void FetchCompleted(ConfigResponse configResponse)
        {
            Debug.Log($"FetchCompleted, status: {configResponse.status}");
           
            DownloadAssets();
        }

How can I fix it? Host server settings?

When you are viewing this page in your browser, can you capture a network session with Charles Proxy on your local system? Review and attach the .chls file here, I will also check with engineering here. Install the Charles root certificate as described and reboot. This should give us additional troubleshooting information https://support.unity.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity

Done.

6637672–757354–chrome.zip (10.6 KB)

Wow, that was fast! And a perfect capture too, thank you. Not sure if it helps, but I do see “error”: “Invalid JSON payload. Invalid appid field, not a valid string value” . Can you share the rest of your RC initialization code? That might be us, but want to confirm.

using Picturethis3d.Categories;
using Picturethis3d.Models;
using Picturethis3d.ProductListControls;
using Picturethis3d.Products;
using Picturethis3d.ProductViewers;
using Unity.RemoteConfig;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.AddressableAssets.ResourceLocators;
using UnityEngine.ResourceManagement.AsyncOperations;

namespace Picturethis3d.ElranProductsViewer
{
    public class Main : MonoBehaviour
    {
        [SerializeField] private ProductViewer _productViewer;

        [SerializeField] private ProductListControl _productListControl = default;

        private struct UserAttributes
        {
        }

        private struct AppAttributes
        {
        }

        void Awake()
        {
            ConfigManager.FetchCompleted += FetchCompleted;

            ConfigManager.SetEnvironmentID("7e3a90d6-32ea-414b-b760-cda48df4078f");

            //        ConfigManager.SetCustomUserID("some-user-id");

            //         ConfigManager.SetEnvironmentID("an-env-id");

            ConfigManager.FetchConfigs<UserAttributes, AppAttributes>(new UserAttributes(), new AppAttributes());
        }

        void FetchCompleted(ConfigResponse configResponse)
        {
            Debug.Log($"FetchCompleted, status: {configResponse.status}");

            DownloadAssets();
        }

        private void DownloadAssets()
        {
            var catalogPath = ConfigManager.appConfig.GetString("catalogPath");
            var catalogFileName = ConfigManager.appConfig.GetString("catalogFileName");

            Debug.Log($"catalogPath: {catalogPath}");
            Debug.Log($"catalogFileName: {catalogFileName}");

            Addressables.LoadContentCatalogAsync(catalogPath + catalogFileName).Completed += OnCompletedLoadCatalog;
        }

        private void OnCompletedLoadCatalog(AsyncOperationHandle<IResourceLocator> operationHandle)
        {
            Debug.Log($"OnCompletedLoadCatalog: {operationHandle.Result}");

            if (operationHandle.Status == AsyncOperationStatus.Succeeded)
            {
                var rootCategoryAssetName = ConfigManager.appConfig.GetString("rootCategoryAssetName");
                Debug.Log($"rootCategoryAssetName: {rootCategoryAssetName}");

                Addressables.LoadAssetAsync<Category>(rootCategoryAssetName).Completed += OnCompleted;
            }
        }

        private void OnCompleted(AsyncOperationHandle<Category> operationHandle)
        {
            Debug.Log($"OnCompleted: {operationHandle.Result}");

            if (operationHandle.Status == AsyncOperationStatus.Succeeded)
            {
                var productId = ConfigManager.appConfig.GetLong("productId");
                Debug.Log($"productId: {productId}");

                _productViewer.Product = Category.Find(productId) as Product;
            }

            _productListControl.RootCategory = operationHandle.Result;
        }


        public void ModelClicked(Model model)
        {
            Debug.Log(model.name);
        }

        public void ListItemProductClicked(Product product)
        {
            Debug.Log(product.name);

            _productViewer.Product = product;
        }
    }
}

Looks good, checking here.

We are having issues in WebGL only as well…
Unity 2019.4.17f1 LTS
Remote Config 2.0.1

We are setting the FetchConfigs handler in Awake() in our main class…

ConfigManager.FetchCompleted += ApplyRemoteSettings;

And we get the following error:

Exception at:
Error
    at jsStackTrace (blob:http://localhost:49290/7a098cb5-5a48-42c8-84e2-ae63dab7e192:749:12)
    at stackTrace (blob:http://localhost:49290/7a098cb5-5a48-42c8-84e2-ae63dab7e192:763:11)
    at blob:http://localhost:49290/7a098cb5-5a48-42c8-84e2-ae63dab7e192:88:36
    at __ZN6il2cpp2vm9Exception5RaiseEP15Il2CppExceptionP10MethodInfo [il2cpp::vm::Exception::Raise(Il2CppException*, MethodInfo*)] (<anonymous>:wasm-function[104377]:0x1b1baa6)
    at __Z30il2cpp_codegen_raise_exceptionP11Exception_tP10MethodInfo [il2cpp_codegen_raise_exception(Exception_t*, MethodInfo*)] (<anonymous>:wasm-function[106211]:0x1b53af3)
    at _FileStream__ctor_mBC5F76C88DBC8C81D1F83407197D75F36E1ADBD7 (<anonymous>:wasm-function[75788]:0x16232d7)
    at _FileStream__ctor_mB254658F1E758D76B41C942CB91BDF38FD544C83 (<anonymous>:wasm-function[75827]:0x16258ba)
    at _File_Open_mDA5EB4A312EAEBF8543B13C572271FB5F673A501 (<anonymous>:wasm-function[75826]:0x162589e)
    at _ConfigManagerImpl_LoadFromCache_m38D6538C08A309F3C946E16AA4F29BFA2A9CF660 (<anonymous>:wasm-function[111176]:0x1c06a93)
    at _ConfigManagerImpl__ctor_m6EEEFEEE93AF449A77D120348F75F9F881C41CB3 (<anonymous>:wasm-function[111170]:0x1c0663a)
    at _ConfigManager__cctor_m7E127ADF1A63FA5FFAB30670A9754FFD2C96E33C (<anonymous>:wasm-function[111169]:0x1c0631b)
    at __Z66RuntimeInvoker_FalseVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017PFvvEPK10MethodInfoPvPS4_ [RuntimeInvoker_FalseVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017(void (*)(), MethodInfo const*, void*, void**)] (<anonymous>:wasm-function[36406]:0xfc4a21)
    at __ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException [il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)] (<anonymous>:wasm-function[104408]:0x1b1c1f3)
    at __ZN6il2cpp2vm7Runtime9ClassInitEP11Il2CppClass [il2cpp::vm::Runtime::ClassInit(Il2CppClass*)] (<anonymous>:wasm-function[104411]:0x1b1c339)
    at __Z33il2cpp_codegen_runtime_class_initP11Il2CppClass [il2cpp_codegen_runtime_class_init(Il2CppClass*)] (<anonymous>:wasm-function[106213]:0x1b53b07)
    at _RemoteConfigHelper_Init_mEA82C1D8D82FD31FDFB0B0F564A83DC443578589 (<anonymous>:wasm-function[45029]:0x10f8a24)
    at _App_Awake_m4CB37CEC83E2C56A21FAD2A12F544929AA785803 (<anonymous>:wasm-function[109869]:0x1bc6974)

Any ideas?

@JRock2424 we are checking but responses may be delayed due to the holidays.

Any update on this?

No updates yet, I’ve asked again. Are you using Newtonsoft.JSON by chance?

Yes - it is part of the Remote Config package…

I just tested Remote Config 2.0.1 in WegGL without issue. I used Unity 2019.4.1f1 in my testing. Please compare to a new/empty project with only Remote Config. You may be seeing an issue with compatibility with another component