# Magento troubleshooting

In general, many Magento problems can be resolved by executing the following Magento commands:

```bash
# in general
magento c:f

# for all issues involving data of the products,
# reviews not being up to date (after change)
magento in:rei

# when Magento 2 module does appear (or function properly)
magento se:up
magento module:enable <MODULE>

# missing classes, issues with Interceptors
rm -rf generated
magento c:f
```

## 404 Not Found on Homepage

There can be multiple reasons why the homepage shows a `404` page. This is usually due to a Magento misconfiguration:

1. Go to *Stores > Configuration > General > Web > Default Pages > CMS Home Page* and check if it is set
2. Go to *Content > Pages* make sure the column `Store View` is not empty for your Home Page CMS page. If it is empty, click on the page, select necessary stores and click save

If nothing has changed and you still see a **404 Not Found** error, try running the following Magento commands:

```bash
magento setup:upgrade
magento setup:di:compile
```

## Luma Theme Visible

If you installed ScandiPWA, but the frontend still displays the Luma theme, follow the steps below.

{% hint style="warning" %}
Verify that the `type` of your theme in the `theme` Magento table to `4`.&#x20;
{% endhint %}

#### Verify that the theme is compiled

Verify that `Magento_Theme` is not be empty, and contains 2 folders. If this is not the case, compile the theme:

{% tabs %}
{% tab title="yarn (Recommended)" %}

```
BUILD_MODE=magento yarn build
```

{% endtab %}

{% tab title="npm" %}

```bash
BUILD_MODE=magento npm run build
```

{% endtab %}
{% endtabs %}

After the command's execution, the folders should appear. If there is a compliation issue, please read the logs to found out why.

#### Verify that the theme is set in the Magento admin panel

Check the *Content > Design > Themes* and make sure your store has the correct ScandiPWA theme set.

#### Flush caches

```bash
magento cache:flush
```

## Asking for Help

If you couldn't resolve your issue, feel free to ask for help! Please see the [guidelines for asking for help](/about/support.md#asking-for-help) in Slack.


---

# 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://docs.scandipwa.com/developing-with-scandi/working-with-magento/magento-troubleshooting.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.
