Reputation: 677
I have a react app. For SEO I am previewing how google see our react app. In our app, if an API fails we show error message on the page. So when we do Fetch as google .. we see that same error. It means API is failing, but in browsers, it is working fine. I am not able to find what is the reason why Google is having an error in fetching api.
We have categorized API response in parts and error message accordingly. So error we are getting means ..error code is between 300 - 400 and anything above 403
Is it due to CORS? or something with react? Any suggestions?
Upvotes: 2
Views: 623
Reputation: 44999
You disallow requesting the API URLs in your robots.txt file. This will block Google from executing your JavaScript code as the API is "unreachable".
See the help center article that is linked from the "Fetch as Google" page:
Google got a response from your site and fetched the URL, but could not reach all resources referenced by the page because they were blocked by robots.txt files. If this is a fetch only, do a fetch and render. Examine the rendered page to see if any significant resources were blocked that could prevent Google from properly analyzing the meaning of the page. If significant resources were blocked, unblock the resources on robots.txt files that you own. For resources blocked by robots.txt files that you don't own, reach out to the resource site owners and ask them to unblock those resources to Googlebot.
You can also see that those pages are only "partial"ly fetched and the detail page will tell you exactly which URLs were blocked and why.
Upvotes: 1