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.
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