Bugfix: Why does the Live Preview iframe not render route content (t...

Documentation for Sessions

🐛 Bugfix: Why does the Live Preview iframe not render route content (t...

Date: 2026-03-16
Time: 16:54:54 UTC
Session: gspace1-225.4
Agent: angular
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

Why does the Live Preview iframe not render route content (table data) from MongoDB?

Task: Not specified


🎯 Decision Made

Chosen:

8-commit fix chain addressing 5 distinct root causes: (1) rspack worker missing splitChunks/dynamicImportMode config, (2) SDK libraries externalized to unresolvable /sdk/v1/ paths in blob URL, (3) Angular JIT incompatible with signal input() — requires @Input() decorators, (4) inject(HttpClient)/inject(Router) fail silently across CDN-loaded modules in blob iframe — replaced with native fetch(), (5) universeId race condition — preview compiled before ProjectManagerService loaded universe context

Options Considered:

  1. Build real SDK ESM libraries and serve at /sdk/v1/ — rejected: heavy, not available in dev
  2. Use Service Worker instead of blob URL — rejected: SW timing issues on first load (S224 tried this)
  3. Use esm.sh CDN for SDK libs — rejected: internal packages not on npm
  4. Stub SDK with native fetch + @Input decorators (chosen) — works in JIT blob iframe context

💭 Reasoning

The preview pipeline had 5 layers of failure, each masking the next. Fix 1-2 (S225.1) got table headers rendering. Fix 3 (S225.5) resolved NG0303 Angular JIT errors. Fix 4 (S225.6) eliminated silent DI failures in the blob iframe. Fix 5 (S225.7) resolved the timing issue where universeId was 'preview' instead of the actual MongoDB _id. Each fix only revealed the next layer. The fundamental architectural tension: blob URL iframes with CDN-loaded Angular modules can't use inject() reliably — native fetch() is the only stable approach for HTTP calls in this context.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation