Architecture: How to fix blank live preview in generated platforms (module...

Documentation for Sessions

🏗️ Architecture: How to fix blank live preview in generated platforms (module...

Date: 2026-03-20
Time: 17:30:03 UTC
Session: gspace1-244.2
Agent: angular
Confidence: 97%
Status: ✅ Documented


📋 Decision Context

Question:

How to fix blank live preview in generated platforms (modules/category/slug structure not detected)?

Task: S244: Fix blank live preview


🎯 Decision Made

Chosen:

Fix module detection regex in preview.service.ts to support both 1-level (modules/{slug}/src/) and 2-level (modules/{category}/{slug}/src/) paths. Updated regex from /^modules/([^/]+)/src// to /^modules/(?:([^/]+)/)?([^/]+)/src// with basePath tracking for correct import path generation.

Options Considered:

  1. Fix the regex to support both path depths
  2. Change generation pipeline to output flat modules/ structure
  3. Add path normalization layer between VFS and bundler

💭 Reasoning

Root cause: The generation pipeline creates modules at modules/{category}/{slug}/src/ (e.g., modules/structural/family-tasks/src/). The preview's detectModulesInVfs() used a regex that only matched one directory level. When the regex failed, zero modules were detected, routes were empty, and router-outlet rendered nothing — producing blank content despite successful compilation. The nav tabs appeared because the synthesized app shell hardcoded navigation, but routes pointed to empty imports. Fix was purely a regex update in the infrastructure (preview.service.ts), not in generated code.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation