Skip to main content

Error handling

400 Bad Request

Errors that prevent the chart from rendering will return a non-200 HTTP status code, most commonly 400 Bad Request. In most cases, the error will be rendered in the requested image format. If an error is rendered in an image, it is also included as a string in the X-quickchart-error HTTP header.

An example error due to invalid chart config - not URL encoded.
An example error due to invalid chart config - not URL encoded.

Invalid or unexpected token

Invalid Chart.js configurations may return errors similar to this one. The most common cause of this error is that the caller forgot to URL-encode the chart variable. The next most common cause is invalid JSON/Javascript syntax in the chart configuration.

Cannot read property <X> of undefined

Access to certain Chart.js internals, used especially in plugins, is restricted due to potential for abuse. Contact us to get whitelisted for these features.

<X> is not a function

Access to certain Chart.js internals, used especially in plugins, is restricted due to potential for abuse. Contact us to get whitelisted for these features.

Certificate errors

If you are receiving a certificate error message while using or accessing QuickChart, or notice of an expired certificate, this likely means that you have an outdated root certificate. To fix, you must update your local CA bundle.

The root cause of this is that a root certificate IdentTrust DST Root CA X3 expired. Those with outdated systems still have this certificate.