# Rebuild To Fix Lib Import Errors

> Rebuild To Fix Lib Import Errors is an Agent Skill for testing & quality published in the LedgerHQ/ledger-live repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

When typecheck finds an error importing from a lib in the monorepo, rebuild the lib

- Skill name: `rebuild-to-fix-lib-import-errors`
- Category: [Testing & Quality](https://www.openparable.com/skill/testing-quality/1)
- Source: https://github.com/LedgerHQ/ledger-live/blob/HEAD/.agents/skills/rebuild-to-fix-lib-import-errors/SKILL.md
- Repository: LedgerHQ/ledger-live (604 GitHub stars when collected)

## SKILL.md

When typecheck finds an error importing from a lib in the monorepo rebuild the lib using the command below:

```shell
nx run @ledgerhq/name_of_lib_here:build
```

## Example

### `live-countervalues-react` has been updated and the import in `live-common` is erroring

We run `typecheck` and get the following error:

> src/currencies/hooks.ts:1:10 - error TS2305: Module '"@ledgerhq/live-countervalues-react"' has no exported member 'useMarketcapIds'.
> 1 import { useMarketcapIds } from "@ledgerhq/live-countervalues-react";

We need to rebuild `@ledgerhq/live-countervalues-react`

```shell
nx run @ledgerhq/live-countervalues-react:build
```

---

Source: https://www.openparable.com/skill/testing-quality/rebuild-to-fix-lib-import-errors (OpenParable). Cite the canonical URL above.
