Unity Player - CORS policy: No Access-Control-Allow-Origin

Username (epiz_29065274);

I’m trying to embed my Unity game into my website, but it doesn’t load. When I check the browsers console this message shows up:

Access to XMLHttpRequest at ‘htps:/infinityfree.net/errors/404/’ (redirected from ‘htp:/hernanmr95.epizy,com/JUEGOS/DogeFever/Build/WebGL.data.unityweb’) from origin ‘htp:/hernanmr95.epizy,com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

And also this:
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://infinityfree.net/errors/404/ with MIME type text/html. See […] for more details.

Please tell me what can I do to fix this. I tried everything I read in the forums.
Thanks a lot

CORS headers are blocked on free hosting.

So there’s no solution unless I go Premium?

Correct.

I have worked in Unity before, and there should be an “Export as web” or “Export as HTML” in the build menu. You may have to create a duplicate project depending on how you have it setup.

3 Likes

This means your code is trying to access the file at htp:/hernanmr95.epizy,com/JUEGOS/DogeFever/Build/WebGL.data.unityweb, but this file cannot be found.

Please double check that you have uploaded the file.

Given that it’s a data file, please check the file size as well. Our servers have a file size limit of 10 MB, and files larger than that are automatically deleted.

1 Like

Thank you! I will check :slight_smile:

You can try out a different way go to replit embed it there and embed into your site

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