# Custom ScandiPWA composer dependency update

There may be an issue when the composer is installing a newer package version than it's required. The newer package can contain the breaking changes that causes project crashes.\
In order to prevent this, ScandiPWA theme should be up to date. But for some cases this is not possible.\
Thus ScandiPWA has strict composer versions for the `scandipwa/*` modules.

{% hint style="warning" %}

### Heads up!

Updating all ScandiPWA modules using `composer update "scandipwa/*"` may lead to the issue described above. Use it on your own risk!
{% endhint %}

The following steps must be completed to update a custom ScandiPWA module to the specific version:

1. [Edit `composer.json`](/getting-started-1/updating-scandipwa/custom-scandipwa-composer-dependency-update.md#1-edit-composer-json)
2. [Update ScandiPWA composer dependencies](/getting-started-1/updating-scandipwa/custom-scandipwa-composer-dependency-update.md#2-update-scandipwa-composer-dependencies)

### 1. Edit `composer.json`

Open a `composer.json` file in your theme directory and set desired version for packages you need. You might want to update multiple packages at once.

### 2. Update ScandiPWA composer dependencies

In order to update ScandiPWA composer dependencies you have to run the `composer update` command with all packages you trying to update.\
For example, if you edited `composer.json` and set new versions to `scandipwa/catalog-graphql` and `scandipwa/compare-graphql`, the command would be the following:

```bash
composer update scandipwa/catalog-graphql scandipwa/compare-graphql
```

{% hint style="warning" %}

### Heads up!

You cannot update a ScandiPWA composer dependency directly, without modifying the `composer.json` file.\
If you try this, you will get the error like this:
{% endhint %}

```bash
Only root package requirements can receive temporary constraints
and scandipwa/quote-graphql is not one
```

{% hint style="warning" %}

### Heads up!

If you don't mention all updated packages in the update command, you will get the following error:
{% endhint %}

```
Your requirements could not be resolved to an installable set of packages.
```


---

# 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/getting-started-1/updating-scandipwa/custom-scandipwa-composer-dependency-update.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.
