Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question built webgl application doesn't load

Discussion in 'Web' started by unity_QTHez4pGeXIHFg, Jul 19, 2020.

  1. unity_QTHez4pGeXIHFg


    Jul 19, 2020
    when i click build and run in the unity editor my application works perfectly but, when i click build and open the index.html file my game gets stuck at the loading screen and in the console it spits out a few error's listed down below. i am very inexperienced with html programming and i have no clue hot to fix this.

    Access to XMLHttpRequest at 'file:///C:/Users/'USER'/Desktop/'PROGRAM'/Build/Build/' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
    Failed to load resource: net::ERR_FAILED
    Uncaught SyntaxError: Invalid or unexpected token
    Uncaught ReferenceError: unityFramework is not defined
    at HTMLScriptElement.n.onload

    edit: the first error was because i opened it as a file so i put it on a server and now i only get the last 2 error's
    Last edited: Jul 19, 2020
  2. healthplexus


    Aug 18, 2017
    Last edited: Jul 23, 2020
    MidniteOil likes this.