Skip to content

Commit

Permalink
docs: axios error
Browse files Browse the repository at this point in the history
  • Loading branch information
yevheniyJ committed Nov 19, 2023
1 parent 899d0f5 commit 52f855d
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions website/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,39 @@ Disable deep merge of json-based files for string-based methods and use shallow

Default: `false`

## Axios error

There might be an issue with axios dependency when using webpack 5 or babel build tools (e.g. [React Scripts 5+](https://create-react-app.dev) or [Expo](https://react.dev/learn/start-a-new-react-project#expo)).

In case if you got following error:

```
ERROR
Cannot read properties of undefined (reading 'create')
TypeError: Cannot read properties of undefined (reading 'create')
```

You will have to manually install [axios 1.6.0](https://github.com/axios/axios)

```bash
npm i axios
```

And pass it in OTA Client config

```typescript
import otaClient from '@crowdin/ota-client';

const client = new otaClient(hash, {
httpClient: {
get: async (url) => {
const res = await axios.get(url);
return res.data;
}
}
});
```

## Further reading

- [API](/api/classes/OtaClient)

0 comments on commit 52f855d

Please sign in to comment.