Search Issue Tracker

Fixed in 2021.1.X



Found in




Issue ID




UnityWebRequest on relative URLs throws an error when Exceptions are set to none



How to reproduce:
1. Open attached project (link in the edit)
2. Go to Project Settings->Player->WebGL->Publishing Settings
3. Make sure Enable Exception are set to None
4. Go to Build Settings and make sure that Development Build is enabled
5. Build the project
6. Launch index.html and observe the developer console in the web browser

Expected results: No errors observed
Actual results: Exception error (attached "Exception.txt") after GetRequest WaitForSeconds and fail to get/load WebRequest

Reproducible with: 2020.2.0b8, 2021.1.0a2
Couldn't test: 2018.4.28f1, 2019.4.12f1, 2020.1.9f1 was not able to downgrade project

Note 1: To launch index.html without CORS policy errors, use Firefox, and follow these steps:
a. Type about:config in the navigation bar
b. Search for the security.fileuri.strict_origin_policy parameter
c. Click that parameter to change it to false
d. Restart Firefox
Note 2: No errors are observed when Enable Exceptions are set to Full With Stacktrace
Note 3: Error only occurs in build, but not in Editor

  1. Resolution Note (fix version 2021.1):

    Fixed in 2021.1.0a8
    Until the fix is released, note the following work around:
    If you use an root-relative URL, starting with a slash, e.g. "/KioskRessources/K1_KioskData_EnCA.json"
    Or use a page-relative URL, but start with the explicit "./", e.g. "./KioskRessources/K1_KioskData_EnCA.json"
    Then the UnityWebRequest should work correctly even when Exceptions are set to None.

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.