Help blocked by CORS policy: Cross origin requests not supported

Hello I am new to developing interactive twitch content.
I have made an interactive chat in Unity for my stream although when i built to WebGl (HTML5) I got the error:
Access to XMLHttpRequest at ‘file:/// - - - /Builds.data.gz’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.

I am using this https://github.com/lexonegit/Unity-Twitch-Chat/blob/master/README.md to interact with the twitch api and I want to host it localy onside of obs using a browser source.

I have no idea what has gone wrong.
I would appreciate any and all help

I just created a new Unity project with only the code from git hub inside and I have the same issue, although I don’t have enough technical knowledge to fix it.

there are no issues inside of unity it is only when built to webGL that i get the following errors:
Access to XMLHttpRequest at ‘file:/// - - - /Builds.data.gz’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
Build/Builds.data.gz:1 Failed to load resource: net::ERR_FAILED
Builds.framework.js.gz:1 Uncaught SyntaxError: Invalid or unexpected token
Builds.loader.js:1 Uncaught ReferenceError: unityFramework is not defined
at HTMLScriptElement.r.onload (Builds.loader.js:1)

Same errors with my version.

What request were you trying to make that caused this response?

All I am doing is reading the chat and getting little stick people to say the messages that are sent in my chat.
Using my twitch oauth key.

Then you need to debug the code and follow it back and find where it’s failing.

Or you need to open an issue with the developer on the repo.

I don’t have enough information here to help you with someone elses code.

The thing is the code is working completely fine, it works perfectly in unity, but when I build to webGL its just a black screen.

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