Bugfix: Why does the live preview compile never trigger even after t...

Documentation for Sessions

πŸ› Bugfix: Why does the live preview compile never trigger even after t...

Date: 2026-03-17
Time: 20:24:50 UTC
Session: gspace1-231.3
Agent: angular
Confidence: 98%
Status: βœ… Documented


πŸ“‹ Decision Context

Question:

Why does the live preview compile never trigger even after the forkJoin timing fix?

Task: Fix live preview not rendering β€” platform compile never triggered


🎯 Decision Made

Chosen:

Fixed the GitLab tree type mapping: listFilesRecursive was preserving raw 'blob'/'tree' values from GitLab but downstream code expected 'file'/'dir'. Map blob→file and tree→dir at source. Also clear loadedModuleSlugs on VFS re-initialization to prevent stale cache across HMR reloads.

Options Considered:

  1. Fix at controller level
  2. Fix in flattenFileNodes to also accept 'directory'
  3. Fix at source in listFilesRecursive (chosen β€” cleanest)

πŸ’­ Reasoning

The broken chain: GitLab returns type:'blob', listFilesRecursive casts but preserves 'blob', git-provider.controller checks f.type==='file' (always FALSE β†’ emits 'tree'), studio-repo.controller checks f.type==='blob' (always FALSE β†’ emits 'directory'), flattenFileNodes finds zero type:'file' items, flatFiles=[], forkJoin completes with empty array, VFS has module dirs but no file contents, detectModulesInVfs returns 0, compileRspack returns early. This was completely invisible because every step had catchError swallowing exceptions silently.


πŸ“ Files Involved


πŸ”— Related


Auto-generated by MCP Smart Consolidation