For the complete documentation index, see llms.txt. This page is also available as Markdown.

Errors and Troubleshooting

The errors that the SDK reports and how to fix them.

Error behavior

The SDK never throws from render(). It hides the panel and fires the error event. Your page keeps working.

cgElement.on('error', ({ code, message }) => {
  console.warn(code, message);
  // Continue checkout without the offer.
});

Error codes

Code
Cause
Fix

presentation_empty

The response has no presentation field, or it is empty.

Send the complete Create Offer response. Check that your offer has a presentation. If it has none, visit Your Program in our Partner Portal and request a change for your Offer Presentation.

presentation_malformed

The presentation field has an invalid shape.

Contact Cover Genius with the response ID.

schema_version_unsupported

The SDK does not know the schema_version.

Update the SDK to the latest version.

not_registered

render() ran before the SDK registered.

Call registerElements() first.

Common problems

The panel does not show
  1. Check that <cg-elements> is in the page.

  2. Check that registerElements() ran in the browser.

  3. Check that getElement() did not return undefined.

  4. Add an error handler and read the code.

  5. Turn on debug mode and read the console.

getElement() returns undefined

registerElements() has not run, or the code runs on a server. Move the call to client-only code.

The wrong panel updates

Two placements share a key. Add a different data-presentation-ref to each element.

The price does not match the quote

The SDK formats the number in finance.price.total_amount with the currency of the response. Check both fields. Check your currencyConfig.

required() does nothing

An option is already selected. The call works only while nothing is selected.

My styles do not change the panel

The panel renders in a shadow root, so your page CSS does not reach it. Ask Cover Genius to change your theme. See Theming.

Debug mode

Turn on debug mode to write SDK logs to the console.

Each render() logs a line with the placement key, the number of products, and whether the response changed from the last one.

Turn debug mode off in production.

Contact support

Send these details to Cover Genius:

  • The SDK version.

  • The offer response id.

  • The presentation.ref value.

  • The browser and version.

  • The error event code and message.

Do not send customer personal data.

Last updated

Was this helpful?