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

    unity_QTHez4pGeXIHFg

    Joined:
    Jul 19, 2020
    Posts:
    1
    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.

    error's:
    Access to XMLHttpRequest at 'file:///C:/Users/'USER'/Desktop/'PROGRAM'/Build/Build/Build.data.br' 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

    healthplexus

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