-
Notifications
You must be signed in to change notification settings - Fork 61
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
CORS Issue when fetching NFT #177
Comments
This is due to some metadata URIs pointing to servers that have CORS headers set in too restrictive way. I’d recommend letting the NFT creators know about this so they can fix it (e.g. by hosting their NFT metadata on IPFS rather than a centralized server), and also to use a JSON proxy server in use-nft, so that NFTs metadata can be accessed when CORS headers are restricting access. You can find an example of this for the use-nft website: https://github.com/spectrexyz/use-nft/blob/89e7c39a2b9c2962cbb481405e2e4baefe3a3862/website/src/App.tsx#L27-L28 I’d also recommend using an image proxy to serve optimized images: https://github.com/spectrexyz/use-nft/blob/89e7c39a2b9c2962cbb481405e2e4baefe3a3862/website/src/App.tsx#L20-L25 |
Closing this, please reopen if needed :) |
thank you it solved my issue. |
Cool :) |
When trying to fetch this NFT:
https://opensea.io/assets/0x2acab3dea77832c09420663b0e1cb386031ba17b/967
it fails due to CORS:
has been blocked by CORS policy: 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
Any suggestion on how this can be solved?
The text was updated successfully, but these errors were encountered: