Skip to content

IsolatedFrame: silent deadlock when bundle load fails #187

@rgbkrk

Description

@rgbkrk

Problem

If the renderer bundle load fails (or provider is missing), IsolatedFrame never transitions to ready, queues messages indefinitely, and does not surface provider failure to consumers via onError. This can leave markdown/html outputs blank indefinitely with no indication of what went wrong.

Location

  • registry/outputs/isolated/isolated-frame.tsx

Suggested Fix

  1. Read error/isLoading from context and emit onError on failure
  2. Optionally add fallback behavior or a timeout to fail fast instead of silent deadlock

Additional Suggestion: Handle eval_result messages

The iframe's bootstrap HTML sends an eval_result message after attempting to eval the renderer bundle. Currently this message is ignored, so bundle eval failures are invisible.

Add handling for eval_result to surface errors:

case "eval_result":
  // Report eval failures to help diagnose bundle injection issues
  if (data.payload?.success === false) {
    console.error("[IsolatedFrame] Bundle eval failed:", data.payload.error);
    onError?.({ message: `Bundle eval failed: ${data.payload.error}` });
  }
  break;

This is especially helpful when debugging JSX runtime issues or other bundling problems where the renderer code fails to initialize inside the sandboxed iframe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions