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:
- Build real SDK ESM libraries and serve at /sdk/v1/ — rejected: heavy, not available in dev
- Use Service Worker instead of blob URL — rejected: SW timing issues on first load (S224 tried this)
- Use esm.sh CDN for SDK libs — rejected: internal packages not on npm
- 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
apps/gograb-space/src/rspack-compiler.worker.jslibs/libs-structural/platform-preview/src/lib/config/sdk-preview-stubs.tslibs/libs-structural/platform-preview/src/lib/services/bundler-filesystem.service.tslibs/libs-structural/platform-preview/src/lib/services/bundler.service.tslibs/libs-structural/vitto-studio/src/lib/services/preview.service.ts
🔗 Related
- Decision ID:
dev_1773680094716_kim4lsf - Session: 225
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation