Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patchURL fails for synchronous Xhr calls. #267

Open
Mark20Builds opened this issue Oct 17, 2024 · 2 comments
Open

patchURL fails for synchronous Xhr calls. #267

Mark20Builds opened this issue Oct 17, 2024 · 2 comments

Comments

@Mark20Builds
Copy link

src/utils/patchUrlMappings.ts << when using patchURL for CocosJS, the error:

"webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-index.js:33 InvalidAccessError: Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be changed for synchronous requests made from a document."

This isn't unique to our games, the Cocos samples produce the same result. Note, if you run Cocos in an iframe (with the proxy prefix) you don't need to use patchURL, however, to run without iframe due to the way Cocos loads this is necessary.

Notes: We call the DiscordSDK from the host-page NOT from within Cocos.

@elainemckinley
Copy link
Contributor

Interesting, I'd love to take a look at this -- do you happen to have a specific example I could run and check this out with? I'm not familiar with Cocos, and hitting a lot of dead links trying to find an example project on my own.

@Mark20Builds
Copy link
Author

https://discord.com/channels/613425648685547541/1220023876029911152/1220023876029911152

That user has a project that can reproduce the issue (and was specifically build for Discord), that said, if you DL CocsCreator and build their hello world for Web you'll see the problem immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants