# Common Build Errors {#common-build-errors}


Troubleshoot common build errors in the Ever Gauzy monorepo.


## `ERROR: Module not found` {#error-module-not-found}


**Cause:** Missing or out-of-sync dependencies.

**Fix:**

```bash
# Clean and reinstall
rm -rf node_modules
yarn install
```


## `ERROR: Cannot find module '@gauzy/contracts'` {#error-cannot-find-module-gauzycontracts}


**Cause:** Internal packages not built.

**Fix:**

```bash
# Build dependencies first
yarn nx build contracts
yarn nx build common
```


## `Angular CLI version mismatch` {#angular-cli-version-mismatch}


**Cause:** Global and local Angular CLI versions differ.

**Fix:**

```bash
npx ng version  # Check versions
npm install -g @angular/cli@latest  # Update global
```


## `Heap out of memory` {#heap-out-of-memory}


**Cause:** TypeScript compilation consuming too much memory.

**Fix:**

```bash
# Increase Node.js memory limit
export NODE_OPTIONS="--max-old-space-size=8192"
yarn build
```


## `TypeORM: Entity not found` {#typeorm-entity-not-found}


**Cause:** Entity not registered in module.

**Fix:** Ensure entity is imported in the module's `TypeOrmModule.forFeature()`:

```typescript
@Module({
  imports: [TypeOrmModule.forFeature([MyEntity])],
})
```


## `MikroORM: Cannot read properties of undefined` {#mikroorm-cannot-read-properties-of-undefined}


**Cause:** MikroORM 6.x stricter metadata validation.

**Fix:** Use conditional decorators based on `DB_ORM`. See [Custom Entity Fields](https://sourcey-gauzy.pages.dev/advanced/custom-entity-fields/index.md).


## NX Build Cache Issues {#nx-build-cache-issues}


```bash
# Clear NX cache
npx nx reset

# Rebuild without cache
npx nx build api --skip-nx-cache
```


## Related Pages {#related-pages}


- [Development Guide](https://sourcey-gauzy.pages.dev/development/development-guide/index.md) — getting started
- [Monorepo Navigation](https://sourcey-gauzy.pages.dev/development/monorepo-navigation/index.md) — repo structure
