Troubleshooting#

How do I know if my page was pre-rendered by headless-render-api.com?#


note: Headless-Render-API.com was previously known as Prerender.cloud (rebranded 2022-05-01)

View the source of the page, and at the very bottom you should see a timestamp:

</body><!-- prerender.cloud processed at: 2017-05-25T03:36:10.649Z --></html>

If you've passed the "prerender-meta-only" HTTP header, then that HTML comment will be right before the closing </head> tag.

Try cmd/ctrl+f and pasting/typing "prerender.cloud processed"


Why isn't Facebook seeing my Open Graph tags?#


This is the most common issue, and it's due to the og:url meta tag.

<meta property="og:url" content="https://www.example.com">

If you have an og:url meta tag on your page, with the content attr set to example.com, then Facebook will consider that (example.com) as the canonical URL and check that instead.

If you have a staging and production environment for your site, AND you have an og:url meta tag, chances are, your og:url is pointing at your production site (which when you're first getting started, may not have Headless-Render-API.com configured)

You can just remove the og:url tag. If you think you need it, just make sure it's pointing to the URL that Headless-Render-API.com is configured for.


How do I clear cache if I've updated my open graph images#


Simplest solution: append a query parameter that you canincrement to the og:image tag, e.g.

# bump v=1 to v=2, v=3, etc. when you update
<meta property="og:image" content="https://headless-render-api.com/og-1200-630.png?v=1" />

Some services have endpoints for this, Google around to find them, for example:

  1. Twitter: https://cards-dev.twitter.com/validator pasting a URL here will clear Twitter's open graph cache for it
  2. Telegram: send the URL to @webpagebot https://stackoverflow.com/a/35156177


How can I use JavaScript to control the HTTP status code?#


Headless-Render-API.com will look for a meta tag with the name attr set to prerender-status-code and it will use the status code in the content attr, for example:

<meta name="prerender-status-code" content="404" />

The only 2 useful status codes here are 404, and 301. If you use 301, there must be a 2nd meta tag for the location header.

<meta name="prerender-status-code" content="301" />
<meta name="prerender-header" content="Location: http://www.example.com" />


Headless-Render-API is returning status 502, and I'm on Cloudflare#


You may have Cloudflare's WAF (web application firewall) enabled which may be returning 403 forbidden to headless-render-api.

Try creating an exception for headless-render-api's user-agent:

  1. in Cloudflare sidebar click "Security"
  2. click "WAF"
  3. Create rule
  4. Edit the form until expression preview reads: (http.user_agent contains "prerendercloud")
  5. Take action: "skip"
  6. start by checking the box "all rate limit rules" and "super bot fight mode rules"

Read more: https://community.cloudflare.com/t/getting-banned-from-my-own-site-error-1010/149617


What if I want to avoid rendering certain content? (like authentication)#


use window.prerenderCloudIsServerSideRendering

if (window.prerenderCloudIsServerSideRendering) {
  auth0 = new FakeAuth0();
} else {
  auth0 = new Auth0Lock(clientId, domain, options);
}


Will my ads and analytics be hit during the prerender?#


We block google-analytics from processing, and some well known ad-networks. Send us the URLs of analytics or ad-networks you'd like us block.


Unable to find element with ID 67 (any number)#


If you see something like the following in the console:

Uncaught Invariant Violation: Minified React error #32; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=32&args[]=67 for the full message or use the non-minified dev environment for full errors and additional helpful warnings

https://legacy.reactjs.org/docs/error-decoder.html/?invariant=32&args%5B%5D=67

This can happen if you have invalid HTML/markup, e.g. a list inside of a p tag:

<p>
  <ol>
    <li>this is an example invalid HTML and will break re-hydration</li>
  </ol/>
</p>

during the re-hydrating/loading server-side or pre-rendered content in the client.

So you'd see this error when loading your app after serving a pre-rendered page, but not when loading your app directly.

To fix it, remove the p tag, or move the list outside of the p tag.

This error message may mean something else, this is just one possible example.


Canceling account#


Headless-Render-API.com is not a subscription, you're only paying for it when you're making API requests. So if you want to stop paying, just stop using it. Credit cards saved with Headless-Render-API.com will be auto deleted after 45 days of no activity.

Since we bill for prior 30 days usage, and you stop using your account the middle of a billing cycle, you'll still get one last bill for whatever you used during the first part of the month.

If you don't want to wait for the full cycle to complete before receiving your final bill, just email support@headless-render-api.com and we'll bill you immediately and remove your account from the system. However, if you still have a headless-render-api integration installed/configured on your webserver, it may start throwing errors - so you must remove this.