# Error 400 / Theme cannot be saved

## Description

When saving the theme configuration, the error message "**Error 400**" or "**Error: Request failed with status code 400**" is displayed and the theme has not been saved.

![Error: Request failed with status code 400](/files/9LKpagy6mZuKwLstpaxn)

Clicking on the button "Show full error" opens a pop-up with the message "`Unable to compile the theme "TcinnThemeWare...". Undefined variable $...`".

![Unable to compile theme](/files/BjkjZY5mKP0g10PsDNm6)

## Cause

The message "**Undefined variable $...**" refers to a theme variable that is used in a configuration field. This is basically possible, but is unfortunately subject to a restriction.

Variables must be initialised before they can be used in another configuration field. This is only the case if the variable has already been defined before the intended configuration field.

The problem affects all configuration fields, but mainly occurs in Shopware standard configuration fields and theme duplicates. (Problematic configuration fields are indicated with corresponding information in their help texts).

## Solution

If you currently entered a variable in a configuration field, reload the theme configuration and change the corresponding configuration field back to an appropriate HEX or RGB value.

If you do not know which configuration field this is, just visit the ThemeWare® Config Finder and search there for the technical name from the error message (e.g. `$twt-color-brand-primary-light`) without the dollar sign "$".

{% embed url="<https://config.themeware.design/en>" %}
ThemeWare® Config Finder
{% endembed %}

#### Issue not solved?

If you could not solve the problem, simply start the ThemeWare® Debugging. You can open a support ticket in case you are not able to solve the problem yourself:

{% embed url="<https://debugging.themeware.design/en>" %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://knowledge.themeware.design/knowledge-base/common-issues/administration/error-400-theme-cannot-be-saved.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
