Unity 2020.2 WebGL - both async and sync fetching of the wasm failed Error

Hello, out of nowhere, I started getting these errors whenever I build for WebGL. I have no async related code as well. Also, I would like to know that the game runs perfectly fine if I do “Build and Run”. But after that, if I were to open via index.html, it would produce that error which is an issue when it comes to publishing on Github Pages.

What’s going on?
Thanks.

172984-screenshot-2020-12-23-011123.jpg

Access to XMLHttpRequest at 'file:///C:/Users/zacha/Desktop/GitHub/_BUILDS/IR-WEBGL/Build/IR-WEBGL.data' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, brave, chrome-untrusted, https.
Build/IR-WEBGL.data:1 Failed to load resource: net::ERR_FAILED
IR-WEBGL.framework.js:2 Fetch API cannot load file:///C:/Users/zacha/Desktop/GitHub/_BUILDS/IR-WEBGL/Build/IR-WEBGL.wasm. URL scheme must be "http" or "https" for CORS request.
doNativeWasm @ IR-WEBGL.framework.js:2
IR-WEBGL.loader.js:1 wasm streaming compile failed: TypeError: Failed to fetch
printErr @ IR-WEBGL.loader.js:1
IR-WEBGL.loader.js:1 falling back to ArrayBuffer instantiation
printErr @ IR-WEBGL.loader.js:1
IR-WEBGL.framework.js:2 Fetch API cannot load file:///C:/Users/zacha/Desktop/GitHub/_BUILDS/IR-WEBGL/Build/IR-WEBGL.wasm. URL scheme must be "http" or "https" for CORS request.
getBinaryPromise @ IR-WEBGL.framework.js:2
IR-WEBGL.loader.js:1 both async and sync fetching of the wasm failed
IR-WEBGL.loader.js:1 both async and sync fetching of the wasm failed
printErr @ IR-WEBGL.loader.js:1
IR-WEBGL.loader.js:1 failed to asynchronously prepare wasm: TypeError: WebAssembly.instantiate(): Argument 0 must be a buffer source or a WebAssembly.Module object
printErr @ IR-WEBGL.loader.js:1

Finally got it by changing the publishing settings to:

173043-screenshot-2020-12-24-032633.jpg

And added a web.config file next to the index.html file that had:

   <configuration>
        <system.webServer>
           <staticContent>
      
              <mimeMap fileExtension=".unityweb" mimeType ="TYPE/SUBTYPE" />
           </staticContent>
        </system.webServer> 
     </configuration>

thank you for actually posting the solution that you found for your problem when noone else did!
really helped me out <3