Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

cors errors when running examples in browser #793

Closed
ryanleecode opened this issue Mar 24, 2023 · 1 comment · Fixed by #834
Closed

cors errors when running examples in browser #793

ryanleecode opened this issue Mar 24, 2023 · 1 comment · Fixed by #834
Assignees

Comments

@ryanleecode
Copy link
Contributor

Access to fetch at 'http://localhost:4646/frame/dev/polkadot/@v0.9.37/user_i' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
VM25:2942          POST http://localhost:4646/frame/dev/polkadot/@v0.9.37/user_i net::ERR_FAILED
users2 @ VM25:2942
(anonymous) @ VM25:21410
VM20:2728 TypeError: Failed to fetch
    at users2 (<anonymous>:2942:28)
    at <anonymous>:21410:21
@ryanleecode ryanleecode changed the title CORS errors when running examples in browser cors errors when running examples in browser Mar 24, 2023
@robocapi robocapi added this to Capi Mar 24, 2023
@tjjfvi
Copy link
Contributor

tjjfvi commented Mar 25, 2023

Ah yes, we need to add the proper cors headers to all requests returned by the local server, as well as the two capi.dev servers.

Probably best solved with a handleCors wrapper a la handleErrors.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants