You are now following this topic
- You will see updates in your content feed.
- You may receive emails, depending on your notification preferences.
starting to get ERROR : blocked by CORS policy
Hello
From earlier today a project i've been working on has stopped working. It was working for the last couple of weeks with no coding updates in the mean time.
The error i'm only now getting is
"from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."
Im transferring four readings from thingspeak to a web page
the get command i'm using is. xhttp.open("GET", "https://api.thingspeak.com/channels/752230/feeds/last", false); xhttp.send();
Why would i only start receiving this error today. If more information is needed i will send it on.
any insights would be much appreciated.
Thanks
Trev
21 Comments
Permanently delete this reply?
This cannot be undone.
Will appreciate an early response....
I'm not able to reproduce the issue. As you can see below, many users have confirmed the issue has been resolved a while back.
Out of curiosity, I look at this file and see that your timeout is 10 seconds. With a free account, your channel can only be updated every 15 seconds. Can you help me understand why you need to poll ThingSpeak every 10 seconds?
Permanently delete this reply?
This cannot be undone.
Apart from frequent polling, there were couple of issues which have been sorted. Now, it is working fine! Thank you very much for your support!!
Is this issue really fixed?
I have this simple HTML app that makes a request to 'feeds.json': https://github.com/rnswamy1954/Hello-World/blob/master/index.html#L126
I can make the exact same request from CURL/POSTMAN/browser-url and I get the response properly.
But when am trying to load my HTML page, I get response with status = 0 and type = opaque
As you can see, my request is going to api.thingspeak And I do have 'no-cors' in my request header. Any help will be greatly appreaciated
Yes - the issue was resolved a while back. Many users have confirmed it on this thread. If you are still experiencing it, you may need to clear your browser cache and reload your page.
I look at this file and see that your timeout is 10 seconds. With a free account, your channel can only be updated every 15 seconds. Can you help me understand why you need to poll ThingSpeak every 10 seconds?
I'm still getting the "CORS Missing Allow Origin" error on the URL https://thingspeak.com/channels/[channelid]/feed.json
Change the url from https://ThingSpeak.com/... To https://api.thingspeak.com/...
Thanks! It's fine now.
This is resolved. If anyone is still seeing issues, please reply to this response.
Vinod, yes I am still being this same issue. API calls had been working for 6 months and suddenly I am receiving CORS errors. Here is what I am getting:
Please let me know when this will be fixed for my example. Thanks!
Do yo see this if you use a fresh browser and sign out and then back in? Make sure you close all other browsers signed in to MathWorks.
Hi yes, I always flush the cache and believe I have only one browser open at a time. I now am able to get the API to work if I use a getJSON call rather than fetch.
Thanks for the update.
Just letting you know our web Dashboard is down since this CORS issue came about.
I apologize for the disruption. The fix should be in place later today.
We are aware of this issue and are working on a fix. Thank you for letting us know.
A server-side configuration change has resulted in a XHR requests to ThingSpeak being blocked at the browser (i.e., ThingSpeak servers do not even see the request). You can confirm that the requests still work by making them from a different client - like cURL or POSTMAN.
A fix is being worked on and we anticipate it being released shortly.
Thanks Christopher - glad to hear a fix is in progress.
I'm seeing the same problem from my ThingSpeak plugin: Access to XMLHttpRequest at 'https://api.thingspeak.com/channels/8203/feeds.json?days=2' from origin 'https://thingspeak.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
best regards, Tony
Same problem. Using highstock chart from two days i receive error while trying getJSON request.
Thanks - I am also getting this problem which started yesterday as far as I can tell (using highstockchart to retrieve data, this was working 2 days ago)
thanks for the quick response
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)