question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CORS error when querying from localhost

See original GitHub issue

Sometimes I see the following error:

Access to fetch at 'https://api.coingecko.com/api/v3/simple/price?ids=solana&vs_currencies=usd' from origin 'http://localhost:3000' 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.
request.js:145 GET https://api.coingecko.com/api/v3/simple/price?ids=solana&vs_currencies=usd net::ERR_FAILED 429

Is it possible to set the no-cors request mode as suggested by the error?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
chidgcommented, Oct 6, 2022

Warning to Googlers - Please read the linked Stack Overflow post above before following @HelpSupports advice

1reaction
HelpSupportscommented, Jun 6, 2022

Sometimes I see the following error:


Access to fetch at 'https://api.coingecko.com/api/v3/simple/price?ids=solana&vs_currencies=usd' from origin 'http://localhost:3000' 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.

request.js:145 GET https://api.coingecko.com/api/v3/simple/price?ids=solana&vs_currencies=usd net::ERR_FAILED 429

Is it possible to set the no-cors request mode as suggested by the error?

Yes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoiding CORS Errors on Localhost (in 2020) | by Andy Potts
This is a simple guide to explain the two main solutions for disabling cross origin restrictions on localhost which I will explain in...
Read more >
Why does my http://localhost CORS origin not work?
On my development machine, I added a fake domain in my hosts file similar to http://myfakedomain.notarealtld and set it to 127.0.0.1. Then I...
Read more >
Fixing Common Problems with CORS and JavaScript
Tutorial: This post walks through troubleshooting and fixing common problems associated with calling REST APIs from JavaScript.
Read more >
Avoiding CORS errors on localhost (in 2020)
1. Use the proxy setting in Create React App · 2. Disable CORS in the browser · 3. Use a proxy to avoid...
Read more >
CORS errors - HTTP - MDN Web Docs - Mozilla
If the CORS configuration isn't setup correctly, the browser console will present an error like "Cross-Origin Request Blocked: The Same Origin ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found