Bugfix: Why were backend-api and backend-ai-api failing to build wit...

Documentation for Sessions

🐛 Bugfix: Why were backend-api and backend-ai-api failing to build wit...

Date: 2026-01-23
Time: 04:01:52 UTC
Session: editor2-61.2
Agent: backend
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

Why were backend-api and backend-ai-api failing to build with '@libs-api/backend-core' not found?

Task: Fix backend-api and backend-ai-api build errors - missing @libs-api/backend-core module


🎯 Decision Made

Chosen:

Fix project.json paths and remove rootDir from tsconfig.lib.json in libs-api libraries

Options Considered:

  1. Check tsconfig.base.json path mappings
  2. Fix project.json paths in libs-api libraries
  3. Rebuild with cache clear

💭 Reasoning

The libs-api libraries (backend-core, api-contracts) had incorrect paths in their project.json files - they referenced libs/backend-core/ but the actual libraries were at libs/libs-api/backend-core/. Additionally, tsconfig.lib.json files had rootDir which violates workspace rules. Fixed: (1) Updated project.json sourceRoot, outputPath, tsConfig, main, assets to correct libs/libs-api/... paths, (2) Removed rootDir from tsconfig.lib.json, (3) Fixed outDir to use correct depth (../../../). Both backends now build successfully.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation