Search Issue Tracker

Fixed in 2021.1

Fixed in 2019.4, 2020.1, 2020.2

Fix In Review for 2018.4

Votes

0

Found in

2018.4

2021.1

Issue ID

1284215

Regression

No

[WebGL][macOS] Builds do not run when using Big Sur

WebGL

-

How to reproduce:
1. Create an empty project
2. In the Build Settings, select WebGL
3. Build and run

Expected result: No errors are thrown
Actual result: UnityLoader.js throws an error

Reproducible with: 2018.4.29f1, 2019.4.15f1, 2020.1.15f1, 2020.2.0b13, 2021.1.0a1

  1. Response avatar

    Resolution Note (fix version 2021.1):

    Fixed in Unity 2021.1.0a2 and above

  2. Response avatar

    Resolution Note (fix version 2020.2):

    Fixed in 2020.2.0b12

  3. Response avatar

    Resolution Note (fix version 2019.4):

    Fixed in 2019.4.21f1

Comments (10)

  1. E22b1acfefb62a467d9ff236a1c12422?d=mm

    greggman

    Jan 29, 2021 01:45

    Fixed in 2019.4.18f1 (didn't check versions before that)

    Did notice 99% of the unity webgl games on itch.io don't run on Big Sur Chrome because of this Unity bug.

    Filed a bug on Chrome just incase they want to revisit the userAgent string to work around unity's bug

    bugs.chromium.org/p/chromium/issues/detail?id=1171998

  2. 0033a37f83e452263036e17425306172?d=mm

    omer_unity939

    Dec 28, 2020 09:03

    PERPLEX_BCN thanks ! thats a quick and easy hack :]

  3. F7532c47793fa52678200bfbb237d3ab?d=mm

    justadropofwater

    Dec 21, 2020 15:27

    Why is it acceptable that this is broken for almost two months for the LTS version?

  4. 1d1551b1846137e8d2fee8803e63a449?d=mm

    Franzeus

    Nov 30, 2020 10:54

    We did kind of a small hack to fix it. Basically we overwrite the userAgent to a working version and set it back:

    /**
    * Overwriting the UnityLoader to fix a bug in their regular expression for Mac OS X 11+
    */
    (function() {
    if (!window["UnityLoader"]) return;

    // Get OS Version (Intel Mac OS X 11_0)
    var os_version = /Mac OS X ([\.\_\d]+)/.exec(navigator.userAgent);
    if (os_version && os_version[1]) {
    // Extract "10_15_7" -> 10
    os_version = parseInt(os_version[1].split("_")[0], 10);
    }

    // The issue occured with Mac OS X 11+
    if (os_version && os_version >= 11) {

    UnityLoader.OriginalSystemInfo = UnityLoader.SystemInfo;

    UnityLoader.SystemInfo = function() {
    try {
    return UnityLoader.OriginalSystemInfo();
    } catch () {
    var original_ua = navigator.userAgent;

    // Overwrite the user agent with a one we know was working:
    var valid_ua = navigator.userAgent.replace(/Mac OS X ([\.\_\d]+)/, "Mac OS X 10_15_7");
    window.navigator.__defineGetter__('userAgent', function () {
    return valid_ua;
    });

    var result = UnityLoader.OriginalSystemInfo();

    // Restore original userAgent
    window.navigator.__defineGetter__('userAgent', function () {
    return original_ua;
    });

    return result;
    }
    };
    }

    })();

    Obviously this script has to get loaded after the UnityLoader.js

  5. 8484793d30143d6db38f2538a18c23ee?d=mm

    roy_tangelogames

    Nov 25, 2020 10:48

    Will you support it in the next 2019 patch as well?
    Unfortunately we have games which were developed in older versions then 2021.

  6. F4f10cd5a8b92bcb2a8dfa2a24071d1d?d=mm

    jeffreylanters

    Nov 25, 2020 10:42

    Same here, happens on Chrome (all versions) only. Safari 14.0.1 seems to bypass this Regex.

  7. 3b9819470083e28ebda310dfe53a3b6e?d=mm

    bradenroper

    Nov 24, 2020 15:00

    Is this issue only on the dev side? We have a lot of WebGL games that we build on Windows machines that are throwing an error when being played on Chrome in Big Sur. It would be nice to know if it's an issue with Chrome on Big Sur or the OS itself, because a lot of our Unity games were built with various older versions of Unity and were not planned for updates just yet.

  8. 48ffb37ef30305da66cf406a809de5bd?d=mm

    perplex_bcn

    Nov 24, 2020 14:46

    In UnityLoader.js find this text: /Mac OS X (10[\.\_\d]+)/.exec(i)[1];
    That's a regular expression. Replace 10 with 1[0-1]
    This way it will allow both 10 and 11

  9. F48c4a859ce09558e1fc8a807255c1a0?d=mm

    Becreatives

    Nov 18, 2020 15:12

    And what is the solution?

  10. 2dc35dbc99d58b7c158b227a845b00c1?d=mm

    Stefterv

    Oct 23, 2020 05:51

    The regex checking for which fails because it does not expect the version number to start with 11.

    In this line:
    h = /Mac OS X (10[\.\_\d]+)/.exec(s)[1];

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.