Saltar al contenido principal

Common Build Errors

Troubleshoot common build errors in the Ever Gauzy monorepo.

ERROR: Module not foundโ€‹

Cause: Missing or out-of-sync dependencies.

Fix:

# Clean and reinstall
rm -rf node_modules
yarn install

ERROR: Cannot find module '@gauzy/contracts'โ€‹

Cause: Internal packages not built.

Fix:

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

Angular CLI version mismatchโ€‹

Cause: Global and local Angular CLI versions differ.

Fix:

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

Heap out of memoryโ€‹

Cause: TypeScript compilation consuming too much memory.

Fix:

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

TypeORM: Entity not foundโ€‹

Cause: Entity not registered in module.

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

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

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.

NX Build Cache Issuesโ€‹

# Clear NX cache
npx nx reset

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