> For the complete documentation index, see [llms.txt](https://partner-docs.covergenius.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://partner-docs.covergenius.com/elements/reference/errors-and-troubleshooting.md).

# 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.

```js
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

<details>

<summary>The panel does not show</summary>

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.

</details>

<details>

<summary>getElement() returns undefined</summary>

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

</details>

<details>

<summary>The wrong panel updates</summary>

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

</details>

<details>

<summary>The price does not match the quote</summary>

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

</details>

<details>

<summary>required() does nothing</summary>

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

</details>

<details>

<summary>My styles do not change the panel</summary>

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

</details>

### Debug mode

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

```js
registerElements({ environment: 'develop', debug: true });
```

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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://partner-docs.covergenius.com/elements/reference/errors-and-troubleshooting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
