godot web project: fetch failed

Godot Version

4.4.stable

Question

i just created simple godot project in compability mode, but godot page failed to fetch. Browser logs:
index.html:221 Access to fetch at ‘file:///C:/Users/%D0%9C%D0%B0%D0%BA%D1%81%D0%B8%D0%BC/Documents/GodotExports/ballsArena/index.wasm’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
index.wasm:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to fetch at ‘file:///C:/Users/%D0%9C%D0%B0%D0%BA%D1%81%D0%B8%D0%BC/Documents/GodotExports/ballsArena/index.pck’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
index.pck:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to fetch at ‘file:///C:/Users/%D0%9C%D0%B0%D0%BA%D1%81%D0%B8%D0%BC/Documents/GodotExports/ballsArena/index.wasm’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
index.wasm:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to fetch at ‘file:///C:/Users/%D0%9C%D0%B0%D0%BA%D1%81%D0%B8%D0%BC/Documents/GodotExports/ballsArena/index.pck’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
index.pck:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to fetch at ‘file:///C:/Users/%D0%9C%D0%B0%D0%BA%D1%81%D0%B8%D0%BC/Documents/GodotExports/ballsArena/index.wasm’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
index.wasm:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to fetch at ‘file:///C:/Users/%D0%9C%D0%B0%D0%BA%D1%81%D0%B8%D0%BC/Documents/GodotExports/ballsArena/index.pck’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
index.pck:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to fetch at ‘file:///C:/Users/%D0%9C%D0%B0%D0%BA%D1%81%D0%B8%D0%BC/Documents/GodotExports/ballsArena/index.wasm’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
index.wasm:1 Failed to load resource: net::ERR_FAILED
index.html:1 Access to fetch at ‘file:///C:/Users/%D0%9C%D0%B0%D0%BA%D1%81%D0%B8%D0%BC/Documents/GodotExports/ballsArena/index.pck’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
index.pck:1 Failed to load resource: net::ERR_FAILED
index.html:153 TypeError: Failed to fetch
at loadFetch (index.js:162:10)
at retry (index.js:185:10)
at index.js:181:6
displayFailureNotice @ index.html:153
index.js:162 Uncaught (in promise) TypeError: Failed to fetch

You need to run the project in a server. Locally launching the html file by double-clicking it won’t work.

If you have python installed you can create a local server in one line from a cmd/terminal with

$ python3 -m http.server

You’ll need to do that in the folder where you exported your project.

Here are some other methods to run a local server How do you set up a local testing server? - Learn web development | MDN

thanks, sir

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.