I have a React app hosted on GitHub that makes a call out to the newsapi.org API. Locally the app is working fine, but in gh-pages URL in some browsers i.e. chrome I am getting the following error which is not allowing the newsapi information to load:
Unchecked runtime.lastError: The message port closed before a response was received.
GET https://newsapi.org/v2/top-headlines?country=us&apiKey=7a4e481d736140efae783b1bfd607fbe 426
createError.js:16
Uncaught (in promise) Error: Request failed with status code 426
at e.exports (createError.js:16)
at e.exports (settle.js:17)
at XMLHttpRequest.p.onreadystatechange (xhr.js:61)
The repo is at https://github.com/MarkMGill/Newscast, and gh-pages URL is https://markmgill.github.io/Newscast/. I've tried googling 426, but there isn't a lot of useful info I can find. Appreciate anyone who may know how to resolve this.
Just researched some more and found new information saying newsapi.org has changed its free service to only allow API calls locally. This explains why my app in gh-pages is no longer loading API info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With